[JBossWS] - WSException from a servlet
by Sanver
Hi, I'm using a JBossWS to publish an interface via webServices.
I've configured my web.xml to show the service as follows.
| <?xml version="1.0" encoding="utf-8"?>
| <web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
| <display-name>ICMWebServices</display-name>
| <servlet>
| <servlet-name>ImageProcessor</servlet-name>
| <servlet-class>mat.icm.ImageProcessor</servlet-class>
| </servlet>
|
| <servlet>
| <servlet-name>ServiciosICM</servlet-name>
| <servlet-class>mat.icm.ServiciosICM</servlet-class>
| </servlet>
| <servlet-mapping>
| <servlet-name>ImageProcessor</servlet-name>
| <url-pattern>/image</url-pattern>
| </servlet-mapping>
| <servlet-mapping>
| <servlet-name>ServiciosICM</servlet-name>
| <url-pattern>/ICMWebServices</url-pattern>
| </servlet-mapping>
| </web-app>
|
but it seems that somehow, the already existing servlet (ImageProcessor) has stop working, because, when i try to access to it, the following exception is thrown...
org.jboss.ws.WSException: Cannot obtain endpoint for: jboss.ws:context=ICMWebCore,endpoint=ImageProcessor
| org.jboss.ws.server.StandardEndpointServlet.initServiceEndpoint(StandardEndpointServlet.java:162)
| org.jboss.ws.integration.jboss.JBossServiceEndpointServlet.initServiceEndpoint(JBossServiceEndpointServlet.java:49)
| org.jboss.ws.server.StandardEndpointServlet.service(StandardEndpointServlet.java:74)
| javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
| org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
I don't know why it's happening, but if i eliminate the Webservice part, the other servlet works fine...
I hope someone can help me. Best regards
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4026564#4026564
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4026564
17 years, 9 months
[JBossWS] - Re: lower timeout in accessing a web service
by jemodurn
JBWS-1410 is working for JAX-RPC but it is not working for JAX-WS. Is there a jira for this?
Here is a test case:
modify the JSR181WebServiceJSETestCase in the jbossws-1.2.0 samples can reproduce the problem.
public void testWebService() throws Exception
| {
| URL wsdlURL = new File("resources/jaxws/samples/jsr181pojo/META-INF/wsdl/TestService.wsdl").toURL();
| QName qname = new QName("http://org.jboss.ws/samples/jsr181pojo", "TestService");
| Service service = Service.create(wsdlURL, qname);
| port = (EndpointInterface)service.getPort(EndpointInterface.class);
|
| ((Stub) port)._setProperty(StubExt.PROPERTY_CLIENT_TIMEOUT, String
| .valueOf(500));
|
| Object retObj = port.echo(new String[]{});
| assertNotNull(retObj);
| assertEquals(0, ((String[])retObj).length);
| }
Testcase: testWebService took 1.672 sec
| Caused an ERROR
| $Proxy17
| java.lang.ClassCastException: $Proxy17
| at org.jboss.test.ws.jaxws.samples.jsr181pojo.JSR181WebServiceJSETestCase.testWebService(JSR181WebServiceJSETestCase.java:72)
| at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
| at junit.extensions.TestSetup$1.protect(TestSetup.java:23)
| at junit.extensions.TestSetup.run(TestSetup.java:27)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4026494#4026494
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4026494
17 years, 9 months
[JBossWS] - Problem using wstools
by d_pavel
Hi All,
I want to implement web services in my project which is a j2ee web application based on JBoss AS 4.0.5.GA and jbossws-1.2.0.GA.
I installed JBoss AS using "jems-installer-1.2.0.GA.jar" on RedHat Linux RHEL4 (using "all" as a profile for the AS). I bought the "JBoss at Work" book but it's using the sun's jwsdp tool. Since I'm using JBoss I want to leverage the wstools which comes with jbossws-1.2.0.GA.
I am trying to implement first the JSR-109 JAX-RPC Service Endpoints:
1) Here is my SEI:
| package generic.hello;
|
| import java.rmi.Remote;
| import java.rmi.RemoteException;
|
| public interface Service_SEI_Interface extends Remote
| {
|
| public String hello(String name) throws RemoteException;
|
| public String purchase (String person, String product) throws RemoteException;
|
| }
|
2)Here is my JSE:
| package generic.hello;
|
| /**
| *
| * @author dragos
| *
| * This class represents the Endpoint Implementation Bean (=our web service implementation).
| * JAX-RPC service endpoints (JSEs) provide web services from the web tier. They take the form of a simple
| * Java objects that masquerade as servlets. This case is implemented in this generic package.
| * In other specs this is reffer to as "Java Service Skeleton".
| */
| public class POJO_EndpointJSE
| {
| //ddd - insert all business methods that we provide and expose as web services
|
| public String hello(String name)
| {
| System.out.println("Hello There : " + name + "!");
| return "Hello There : " + name + "!";
| }
|
| public String purchase (String person, String product)
| {
| System.out.println("DDD_EndpointJSE purchase: " + person + "," + product);
| return "ok" + person + product;
| }
| }
|
3) the input configuration file (wstools-config.xml) for the wstools:
| <?xml version="1.0" encoding="UTF-8"?>
|
| <!-- using this config file, wstools can generate the JSR-109 required number of deployment artifacts, which are:
| ? webservices.xml, the deployment descriptor that identifies a deployment of a web service endpoint
| ? wsdl, the abstract webservice contract
| ? jaxrpc-mapping.xml, the mapping desriptor that bridges WSDL to java -->
|
|
| <!-- RPC Style Endpoint -->
| <configuration xmlns="http://www.jboss.org/jbossws-tools">
| <java-wsdl>
| <!-- ddd The service element defines the interface our web service provides -->
| <service name="SampleService"
| style="rpc"
| endpoint="generic.hello.Service_SEI_Interface"/>
| <namespaces target-namespace="http://hello.generic/"
| type-namespace="http://hello.generic/types"/>
| <mapping file="jaxrpc-mapping.xml"/>
| <webservices servlet-link="HelloWorldWS"/>
| </java-wsdl>
| </configuration>
|
4)I am running WSTools from the command line like this:
/usr/local/jboss-4.0.5.GA/bin/wstools.sh -cp /home/dragos/SW/myeclipsews/testbenchWS/WebRoot/WEB-INF/classes/generic/hello/Service_SEI_Interface -config ./wstools-config.xml
5)Here is my web.xml file:
| <?xml version="1.0" encoding="UTF-8"?>
|
| <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
| http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
| version="2.4">
|
| <!-- ddd declare a pseudo-servlet -->
|
| <servlet>
| <servlet-name>HelloWorldWS</servlet-name>
| <servlet-class>generic.hello.POJO_EndpointJSE</servlet-class>
| <load-on-startup>0</load-on-startup>
| </servlet>
|
| <!-- ddd :
| | 1) We declare our web service implementation class as a servlet and provide a servlet mapping
| | that will respond to the web service invocations
| | 2) The URL pattern in the servlet mapping is the only externally visible configuration element
| | = URL the web service lives at = will be primarily noticed as the location of the WSDL file for this service
| -->
|
| <servlet-mapping>
| <servlet-name>HelloWorldWS</servlet-name>
| <!-- url-pattern>/Service_SEI_Interface</url-pattern -->
| <url-pattern>/services/*</url-pattern>
| </servlet-mapping>
|
| </web-app>
|
6) Here is the output from the command line wstools:
| <?xml version="1.0" encoding="UTF-8"?>
|
| <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
| http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
| version="2.4">
|
| <!-- ddd declare a pseudo-servlet -->
|
| <servlet>
| <servlet-name>HelloWorldWS</servlet-name>
| <servlet-class>generic.hello.POJO_EndpointJSE</servlet-class>
| <load-on-startup>0</load-on-startup>
| </servlet>
|
| <!-- ddd :
| | 1) We declare our web service implementation class as a servlet and provide a servlet mapping
| | that will respond to the web service invocations
| | 2) The URL pattern in the servlet mapping is the only externally visible configuration element
| | = URL the web service lives at = will be primarily noticed as the location of the WSDL file for this service
| -->
|
| <servlet-mapping>
| <servlet-name>HelloWorldWS</servlet-name>
| <!-- url-pattern>/Service_SEI_Interface</url-pattern -->
| <url-pattern>/services/*</url-pattern>
| </servlet-mapping>
|
| </web-app>
|
7)To me it looks like the parameters passed to anonymous wrote : handleJavaToWSDLGeneration(Configuration config, String outDir) are not instantiated properly cause I not see otherways why later I can't load the end point class. Here is the pertinent code from the ToolsHelper class:
| public void handleJavaToWSDLGeneration(Configuration config, String outDir) throws IOException
|
| jason.greene(a)jboss.com
|
|
|
| 97
|
| 89 {
| 90 JavaToWSDLConfig j2wc = config.getJavaToWSDLConfig(false);
| 91 JavaToWSDL jwsdl = new JavaToWSDL(Constants.NS_WSDL11);
| 92 jwsdl.setServiceName(j2wc.serviceName);
| 93 jwsdl.setTargetNamespace(j2wc.targetNamespace);
| 94 jwsdl.setTypeNamespace(j2wc.typeNamespace);
| 95 jwsdl.setOperationMap(j2wc.operations);
| 96
| 97 if ("document".equals(j2wc.wsdlStyle))
| 98 jwsdl.setStyle(Style.DOCUMENT);
| 99 else if ("rpc".equals(j2wc.wsdlStyle))
| 100 jwsdl.setStyle(Style.RPC);
|
| thomas.diesler(a)jboss.com
|
|
|
| 221
|
| 101 else throw new WSException("Unrecognized Style:" + j2wc.wsdlStyle);
|
| jason.greene(a)jboss.com
|
|
|
| 97
|
| 102
| 103 if ("wrapped".equals(j2wc.parameterStyle))
| 104 jwsdl.setParameterStyle(ParameterStyle.WRAPPED);
| 105 else if ("bare".equals(j2wc.parameterStyle))
| 106 jwsdl.setParameterStyle(ParameterStyle.BARE);
|
| thomas.diesler(a)jboss.com
|
|
|
| 221
|
| 107 else throw new WSException("Unrecognized Parameter Style:" + j2wc.parameterStyle);
|
| jason.greene(a)jboss.com
|
|
|
| 97
|
| 108
| 109 Class endpointClass = loadClass(j2wc.endpointName);
| 110
|
| thomas.diesler(a)jboss.com
|
|
|
| 221
|
| 111 if (endpointClass == null)
| 112 throw new WSException("Endpoint " + j2wc.endpointName + " cannot be loaded");
| ............
|
8) Any ideas about the endpoint class loading issue?
Thanks in advance.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4026475#4026475
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4026475
17 years, 9 months