You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Sheeraz Junejo <ju...@gmail.com> on 2012/12/24 19:42:47 UTC

Fwd: [AXIS2] Unable to call Deployed Service Operation from Code Generated from Generated WSDL

Hi,

I have tried everything but nothing seems to be working, could someone
please help. The problem is that I generate WSDL using following command
using java2wsdl in axis2-1.5.5 release from a web service class;

*java2wsdl -o C:\temp -cp %CLASSPATH% -tn http://OFSConnectorServiceWs -cn
com.temenos.webservices.ofsconnector.OFSConnectorServiceWS*

Deployed the service in jBoss successfully and now if I generate client
using *wsimport* via *
http://localhost:9090/axis2/services/OFSConnectorServiceWS?wsdl (Attached
as file OFSConnectorServiceWS-Deployed.xml) *, everything is OK and I am
able to call my methods perfectly.

Now I want to do the same by generating client using the WSDL file (*Attached
as OFSConnectorServiceWS.wsdl*) I generated in first step using java2wsdl
utility, within maven I have this task;

<build>
<plugins>
<plugin>
<groupId>org.apache.cxf</groupId>
 <artifactId>cxf-codegen-plugin</artifactId>
<executions>
<execution>
 <id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
 <sourceRoot>${project.build.directory}/generated/cxf</sourceRoot>
<wsdlOptions>
 <wsdlOption>
<wsdl>${basedir}/src/main/resources/OFSConnectorServiceWS.wsdl</wsdl>
 <serviceName>OFSConnectorServiceWS</serviceName>
</wsdlOption>
</wsdlOptions>
 </configuration>
<goals>
<goal>*wsdl2java*</goal>
 </goals>
</execution>
</executions>
 </plugin>
</plugins>
</build>

I got the client JAR and wrote simple test class (*Attached as
OfsConnectorWSClientTest.java*) to access the method on deployed service
but getting following exception;

javax.xml.ws.soap.SOAPFaultException: namespace mismatch require
http://OFSConnectorServiceWs found
http://ofsconnector.webservices.temenos.com
 at
com.sun.xml.internal.ws.fault.SOAP12Fault.getProtocolException(SOAP12Fault.java:210)
at
com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:111)
 at
com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:108)
at
com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)
 at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:107)
at $Proxy34.processOFS(Unknown Source)
 at
com.temenos.webservices.ofsconnector.client.OfsConnectorWSClientTest.testProcessOfsUsingJavaWSForSuccess(OfsConnectorWSClientTest.java:63)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
 at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
 at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
 at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at
org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
 at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
 at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
 at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
 at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
 at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
 at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
 at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

Can someone please help?

Thanks

--

Sheeraz Junejo

Re: [AXIS2] Unable to call Deployed Service Operation from Code Generated from Generated WSDL

Posted by Kishanthan Thangarajah <ks...@gmail.com>.
The error trace seems to suggest the issue here. The namespace which is
sent with the message is not what is expected at the server level. You can
use a tool like tcpmon to see what is the request (namespace) is being sent
and check for the correct namespace expected at server side.

Thanks,
Kishanthan.


On Tue, Dec 25, 2012 at 12:12 AM, Sheeraz Junejo
<ju...@gmail.com>wrote:

> Hi,
>
> I have tried everything but nothing seems to be working, could someone
> please help. The problem is that I generate WSDL using following command
> using java2wsdl in axis2-1.5.5 release from a web service class;
>
> *java2wsdl -o C:\temp -cp %CLASSPATH% -tn http://OFSConnectorServiceWs-cn com.temenos.webservices.ofsconnector.OFSConnectorServiceWS
> *
>
> Deployed the service in jBoss successfully and now if I generate client
> using *wsimport* via *
> http://localhost:9090/axis2/services/OFSConnectorServiceWS?wsdl (Attached
> as file OFSConnectorServiceWS-Deployed.xml) *, everything is OK and I am
> able to call my methods perfectly.
>
> Now I want to do the same by generating client using the WSDL file (*Attached
> as OFSConnectorServiceWS.wsdl*) I generated in first step using java2wsdl
> utility, within maven I have this task;
>
> <build>
> <plugins>
> <plugin>
> <groupId>org.apache.cxf</groupId>
>  <artifactId>cxf-codegen-plugin</artifactId>
> <executions>
> <execution>
>  <id>generate-sources</id>
> <phase>generate-sources</phase>
> <configuration>
>  <sourceRoot>${project.build.directory}/generated/cxf</sourceRoot>
> <wsdlOptions>
>  <wsdlOption>
> <wsdl>${basedir}/src/main/resources/OFSConnectorServiceWS.wsdl</wsdl>
>  <serviceName>OFSConnectorServiceWS</serviceName>
> </wsdlOption>
> </wsdlOptions>
>  </configuration>
> <goals>
> <goal>*wsdl2java*</goal>
>  </goals>
> </execution>
> </executions>
>  </plugin>
> </plugins>
> </build>
>
> I got the client JAR and wrote simple test class (*Attached as
> OfsConnectorWSClientTest.java*) to access the method on deployed service
> but getting following exception;
>
> javax.xml.ws.soap.SOAPFaultException: namespace mismatch require
> http://OFSConnectorServiceWs found
> http://ofsconnector.webservices.temenos.com
>  at
> com.sun.xml.internal.ws.fault.SOAP12Fault.getProtocolException(SOAP12Fault.java:210)
> at
> com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:111)
>  at
> com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:108)
> at
> com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)
>  at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:107)
> at $Proxy34.processOFS(Unknown Source)
>  at
> com.temenos.webservices.ofsconnector.client.OfsConnectorWSClientTest.testProcessOfsUsingJavaWSForSuccess(OfsConnectorWSClientTest.java:63)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>  at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>  at java.lang.reflect.Method.invoke(Method.java:597)
> at
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
>  at
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> at
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
>  at
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
> at
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
>  at
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
> at
> org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
>  at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
> at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
>  at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
>  at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
>  at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
>  at
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
> at
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
>  at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
>  at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
>
> Can someone please help?
>
> Thanks
>
> --
>
> Sheeraz Junejo
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>