'What should I do to handle WebServiceException:

I have a web service deployed on localhost. I generated the stubs using the wsimport command on the deployment server. I then used the generated stub in my client using the following code:

    TestService serviceObject=null;
    String url = "http://localhost:9080/ProjWebService/services/Test?wsdl";
    QName qname = new QName("http://testservice.test.sw.com", "TestService ");
    Service service = Service.create(url, qname);
    pullService = service.getPort(TestService .class);
    queryResultSet = serviceObject.webMethod("Hello");

However, I am getting the following error:

[10/4/12 15:14:23:145 ] 00000033 SystemErr     R **javax.xml.ws.WebServiceException: An attempt was made to construct the ServiceDelegate object with an service name that is not valid: {http://testservice.test.sw.com}TestService**.
[10/4/12 15:14:23:146 ] 00000033 SystemErr     R     at org.apache.axis2.jaxws.ExceptionFactory.createWebServiceException(ExceptionFactory.java:173)
[10/4/12 15:14:23:146 ] 00000033 SystemErr     R     at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:70)
[10/4/12 15:14:23:146 ] 00000033 SystemErr     R     at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:118)
[10/4/12 15:14:23:146 ] 00000033 SystemErr     R     at org.apache.axis2.jaxws.spi.ServiceDelegate.<init>(ServiceDelegate.java:218)
[10/4/12 15:14:23:146 ] 00000033 SystemErr     R     at org.apache.axis2.jaxws.spi.Provider.createServiceDelegate(Provider.java:71)
[10/4/12 15:14:23:146 ] 00000033 SystemErr     R     at javax.xml.ws.Service.<init>(Service.java:68)
[10/4/12 15:14:23:146 ] 00000033 SystemErr     R     at javax.xml.ws.Service.create(Service.java:692)
[10/4/12 15:14:23:146 ] 00000033 SystemErr     R     at org.test.poctestservice.ui.bean.testserviceBean.search(testserviceBean.java:425)
[10/4/12 15:14:23:146 ] 00000033 SystemErr     R     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[10/4/12 15:14:23:146 ] 00000033 SystemErr     R     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
[10/4/12 15:14:23:146 ] 00000033 SystemErr     R     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[10/4/12 15:14:23:146 ] 00000033 SystemErr     R     at java.lang.reflect.Method.invoke(Method.java:600)
[10/4/12 15:14:23:146 ] 00000033 SystemErr     R     at org.apache.el.parser.AstValue.invoke(AstValue.java:159)
[10/4/12 15:14:23:146 ] 00000033 SystemErr     R     at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
[10/4/12 15:14:23:146 ] 00000033 SystemErr     R     at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
[10/4/12 15:14:23:146 ] 00000033 SystemErr     R     at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:94)
[10/4/12 15:14:23:146 ] 00000033 SystemErr     R     at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
[10/4/12 15:14:23:146 ] 00000033 SystemErr     R     at javax.faces.component.UICommand.broadcast(UICommand.java:387)
[10/4/12 15:14:23:146 ] 00000033 SystemErr     R     at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:458)
[10/4/12 15:14:23:146 ] 00000033 SystemErr     R     at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:763)
[10/4/12 15:14:23:146 ] 00000033 SystemErr     R     at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
[10/4/12 15:14:23:147 ] 00000033 SystemErr     R     at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
[10/4/12 15:14:23:147 ] 00000033 SystemErr     R     at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
[10/4/12 15:14:23:147 ] 00000033 SystemErr     R     at com.icesoft.faces.webapp.http.core.JsfLifecycleExecutor.apply(JsfLifecycleExecutor.java:18)
[10/4/12 15:14:23:147 ] 00000033 SystemErr     R     at com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.renderCycle(ReceiveSendUpdates.java:132)
[10/4/12 15:14:23:147 ] 00000033 SystemErr     R     at com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.service(ReceiveSendUpdates.java:74)
[10/4/12 15:14:23:147 ] 00000033 SystemErr     R     at com.icesoft.faces.webapp.http.core.RequestVerifier.service(RequestVerifier.java:31)
[10/4/12 15:14:23:147 ] 00000033 SystemErr     R     at com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer.service(PathDispatcherServer.java:24)
[10/4/12 15:14:23:147 ] 00000033 SystemErr     R     at com.icesoft.faces.webapp.http.servlet.BasicAdaptingServlet.service(BasicAdaptingServlet.java:16)
[10/4/12 15:14:23:147 ] 00000033 SystemErr     R     at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:23)
[10/4/12 15:14:23:147 ] 00000033 SystemErr     R     at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:53)
[10/4/12 15:14:23:147 ] 00000033 SystemErr     R     at com.icesoft.faces.webapp.http.servlet.SessionVerifier.service(SessionVerifier.java:26)
[10/4/12 15:14:23:147 ] 00000033 SystemErr     R     at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:23)
[10/4/12 15:14:23:147 ] 00000033 SystemErr     R     at com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:131)
[10/4/12 15:14:23:147 ] 00000033 SystemErr     R     at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
[10/4/12 15:14:23:147 ] 00000033 SystemErr     R     at com.icesoft.faces.webapp.xmlhttp.BlockingServlet.service(BlockingServlet.java:56)
[10/4/12 15:14:23:147 ] 00000033 SystemErr     R     at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1657)
[10/4/12 15:14:23:147 ] 00000033 SystemErr     R     at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:939)
[10/4/12 15:14:23:147 ] 00000033 SystemErr     R     at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:502)
[10/4/12 15:14:23:147 ] 00000033 SystemErr     R     at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:179)
[10/4/12 15:14:23:147 ] 00000033 SystemErr     R     at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:91)
[10/4/12 15:14:23:147 ] 00000033 SystemErr     R     at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:864)
[10/4/12 15:14:23:147 ] 00000033 SystemErr     R     at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1583)
[10/4/12 15:14:23:147 ] 00000033 SystemErr     R     at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:186)
[10/4/12 15:14:23:148 ] 00000033 SystemErr     R     at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:445)
[10/4/12 15:14:23:148 ] 00000033 SystemErr     R     at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:504)
[10/4/12 15:14:23:148 ] 00000033 SystemErr     R     at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:301)
[10/4/12 15:14:23:148 ] 00000033 SystemErr     R     at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83)
[10/4/12 15:14:23:148 ] 00000033 SystemErr     R     at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
[10/4/12 15:14:23:148 ] 00000033 SystemErr     R     at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
[10/4/12 15:14:23:148 ] 00000033 SystemErr     R     at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
[10/4/12 15:14:23:148 ] 00000033 SystemErr     R     at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
[10/4/12 15:14:23:148 ] 00000033 SystemErr     R     at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
[10/4/12 15:14:23:148 ] 00000033 SystemErr     R     at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
[10/4/12 15:14:23:148 ] 00000033 SystemErr     R     at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
[10/4/12 15:14:23:148 ] 00000033 SystemErr     R     at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1563)



I have followed the steps by removing my axis library from the deployed wars's in the WEB-INF/lib folder. However, I am still getting the same exception. The same code runs fine on the the IBM Websphere WAS 7 integrated in Eclipse. But when I deploy the war on another application server it throws the above exception.

I also consulted this thread: Web Service client generated by wsdl not working with Deployed web sevrice. I generated the stubs using the wsimport utility at /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin and at /opt/IBM/WebSphere/AppServer/java/bin. However, when called in the code, both the stubs produce the same error.



Solution 1:[1]

I had a similar problem, with using spring JaxWsPortProxyFactoryBean

<bean id="test1WSClient" class="org.springframework.remoting.jaxws.JaxWsPortProxyFactoryBean">
    <property name="serviceInterface" value="com.yourpackage.app.web.ws.Test1"/>
    <property name="wsdlDocumentUrl" value="http://localhost:9080/proj7/ws/Test1Service/Test1WebService.wsdl"/>
    <property name="namespaceUri" value="http://ws.web.app.yourpackage.com/"/>
    <property name="serviceName" value="Test1WebService"/>
    <property name="portName" value="Test1Port"/>
</bean>

Make sure you put that '/' in end of namespaceUri. Hope this helps somebody!

Solution 2:[2]

check out http://www-01.ibm.com/support/docview.wss?uid=swg1PM31409 try to add a JVM property: jaxws.ignore.extraWSDLOps=true

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Srimanta Roy
Solution 2 Septem