RE: User Guide: Code generation for client
Title: Message Hi, folks. While I'm flattered to hear that you might think I know what is going on, I'm afraid you are sadly mistaken. :-) Actually, I'm not an Axis developer. I'm just a rather frustrated user, like yourself, who is maybe a bit more verbose than most because I try to ensure that people actually report the bugs in Axis to JIRA so that they get fixed. (Developers typically don't try to fix bugs unless they actually show up in a bug tracking system, so complaining about them on the mailing list is not enough.) I don't have any special knowledge about Axis other than having tripped a bunch of times, fallen flat on my face, and having learned enough to avoid the few specific potholes that I've stepped in. As far as I can tell, your problem is not one of these. As far as diagnosing a data binding error, I would try to capture the data that is being sent from client to server or back (using something like tcpmonitor) and see if the data being transmitted is something reasonable. That will at least tell you if the error is occurring in the client versus in the server. It's also possible that you might be having a problem with 'chunked' data encoding (as described by some other people on the list) screwing up your XML parsing. I haven't had this problem, so I don't know much about it. I would try to make very sure, however, that the version of Axis libraries that you are using for your client,your server, and WSDL2Java are all exactly the same (which should preferably be the latest nightly build you can get).Version skew between these could cause a lot of problemssuch as data binding errors. I also seem to remember there being some discussion to the effect that some of the samples in the user guide were wrong, so you might do some searches on the list to see if your problem is related to this. I also recommend filing a JIRA to the effect that the error message "data binding error" that you seem to be getting is not specific enough to be useful in solving the problem. I think that any such error message generated by Axis or Axiom should at least identify what specific XML element could not be bound, and why. Derek -Original Message-From: jayachandra [mailto:[EMAIL PROTECTED] Sent: Friday, August 11, 2006 12:22 AMTo: axis-user@ws.apache.orgSubject: Re: User Guide: Code generation for client Guys, This issue being discussed seems to be against Axis2, I'd suggest that you append a prefix "[Axis2]" (without quotes) to your messages and post so that your mail lands up in the filters of the saviours :) cheers Jaya On 8/10/06, Deepak Sharma [EMAIL PROTECTED] wrote: Thanks a lot Marcel for your findings. -Deepak On 8/8/06, Marcel Frehner [EMAIL PROTECTED] wrote: According tohttp://www.mail-archive.com/axis-user@ws.apache.org/msg16725.html , which Ihad overlooked before, we need to use the nightly snapshots. I still couldnot get it working. Now I definitely give up and wait for the next Release or at least for the next complete nightly build. Good luck for the rest or you!MarcelAt 18:01 07.08.2006 +0200, you wrote:Hey DeepakBy now I used to run the wsdl2java from Eclipse. Desperate as I am I tried the command line version and got correct stub and skeleton code with the following command:wsdl2java -uri Axis2SampleDocLitService.wsdl -ss -sd -d xmlbeanswsdl2java -uri Axis2SampleDocLitService.wsdl -d xmlbeansThis will also generate a TypeSystemHolder.class which needs to be copiedto the IDE project manually( http://ws.apache.org/axis2/tools/1_0/CodegenToolReference.html).The next error I get is the following:org.apache.axis2.AxisFault: Data binding erroratorg.apache.axis2.description.OutInAxisOperationClient.execute (OutInAxisOperation.java:287)at org.apache.axis2.Axis2SampleDocLitServiceStub.echoString(Axis2SampleDocLitServiceStub.java:481)at org.Client.main(Client.java:25)No idea where that comes from:-( Maybe it's just the AXIS_HOME Good luck!MarcelMy client looks like this:package org;import org.apache.axis2.Axis2SampleDocLitServiceStub;import org.apache.axis2.userguide.xsd.EchoStringParamDocument ;import org.apache.axis2.userguide.xsd.EchoStringReturnDocument;public class Client {public static void main(String[] args){ try {//Create the stub by passing the AXIS_HOME and target EPR. //We pass null to the AXIS_HOME and hence the stub will use the current directory as the AXIS_HOMEAxis2SampleDocLitServiceStub stub= new Axis2SampleDocLitServiceStub(null, "http://localhost:8080/axis2/services/Axis2SampleDocLitService ");//Create the request document to be sent.
Re: User Guide: Code generation for client
Guys, This issue being discussed seems to be against Axis2, I'd suggest that you append a prefix [Axis2] (without quotes) to your messages and post so that your mail lands up in the filters of the saviours :) cheers Jaya On 8/10/06, Deepak Sharma [EMAIL PROTECTED] wrote: Thanks a lot Marcel for your findings. -Deepak On 8/8/06, Marcel Frehner [EMAIL PROTECTED] wrote: According to http://www.mail-archive.com/axis-user@ws.apache.org/msg16725.html , which Ihad overlooked before, we need to use the nightly snapshots. I still couldnot get it working. Now I definitely give up and wait for the next Release or at least for the next complete nightly build. Good luck for the rest or you!MarcelAt 18:01 07.08.2006 +0200, you wrote:Hey DeepakBy now I used to run the wsdl2java from Eclipse. Desperate as I am I tried the command line version and got correct stub and skeleton code with the following command:wsdl2java -uri Axis2SampleDocLitService.wsdl -ss -sd -d xmlbeanswsdl2java -uri Axis2SampleDocLitService.wsdl -d xmlbeansThis will also generate a TypeSystemHolder.class which needs to be copiedto the IDE project manually( http://ws.apache.org/axis2/tools/1_0/CodegenToolReference.html).The next error I get is the following:org.apache.axis2.AxisFault: Data binding erroratorg.apache.axis2.description.OutInAxisOperationClient.execute (OutInAxisOperation.java:287)at org.apache.axis2.Axis2SampleDocLitServiceStub.echoString(Axis2SampleDocLitServiceStub.java:481)at org.Client.main(Client.java:25)No idea where that comes from:-( Maybe it's just the AXIS_HOME Good luck!MarcelMy client looks like this:package org;import org.apache.axis2.Axis2SampleDocLitServiceStub;import org.apache.axis2.userguide.xsd.EchoStringParamDocument ;import org.apache.axis2.userguide.xsd.EchoStringReturnDocument;public class Client {public static void main(String[] args){ try {//Create the stub by passing the AXIS_HOME and target EPR. //We pass null to the AXIS_HOME and hence the stub will use the current directory as the AXIS_HOMEAxis2SampleDocLitServiceStub stub= new Axis2SampleDocLitServiceStub(null, http://localhost:8080/axis2/services/Axis2SampleDocLitService );//Create the request document to be sent. EchoStringParamDocumentreqDoc= EchoStringParamDocument.Factory.newInstance();reqDoc.setEchoStringParam (Axis2 Echo);//invokes the Web service. EchoStringReturnDocument resDoc=stub.echoString(reqDoc);System.out.println(resDoc.getEchoStringReturn()); } catch (Exception e) { e.printStackTrace(); }}}At 11:28 07.08.2006 +0530, you wrote:I would really appreciate if Deepal, Derek or any active member can shed some light on this problem. Thanks,DeepakOn 8/4/06, Marcel Frehnermailto: [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:I gave it another try. But I could not get any further this time. I've stillgot the following client, where stub.echoString() expects anEchoStringParam, which I don't have... package org;import org.apache.axis2.userguide.* ;import org.apache.axis2.userguide.xsd.EchoStringParamDocument;import org.apache.axis2.userguide.xsd.EchoStringReturnDocument ;public class Client {public static void main(String[] args) { try {Axis2SampleDocLitServiceStub stub = new Axis2SampleDocLitServiceStub(null, http://localhost:8080/axis2/services/Axis2SampleDocLitService);EchoStringParamDocument reqDoc = EchoStringParamDocument.Factory .newInstance();reqDoc.setEchoStringParam (Axis2 Echo);EchoStringReturnDocument resDoc = stub.echoString(reqDoc);System.out.println(resDoc.getEchoStringReturn ());} catch (Exception e) {e.printStackTrace ();}}}I would very much appreciate some help!Marcel At 22:21 03.08.2006 +0530, you wrote: Thanks Marcel for the inputs. As I am new to this Axis, so would not be able to comment. I would really appreciate if anyone give us the right direction to resolve this problem. Thanks, Deepak On 8/3/06, Marcel Frehner mailto: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi Deepak I've got the same problem and can't find a solution. Following up your thread about the EchoStringParam I would suggest something like the code below. But what ist the XMLStreamReader supposed to be? I mean, how can I create an EchoStringParam? Marcel *** import org.apache.axis2.userguide.Axis2SampleDocLitServiceStub; import org.apache.axis2.userguide.Axis2SampleDocLitServiceStub.EchoStringParam ; import org.apache.axis2.userguide.Axis2SampleDocLitServiceStub.EchoStringReturn ; import javax.xml.stream.XMLStreamReader; public class Client { public static void main(String[] args) { try { Axis2SampleDocLitServiceStub stub = new Axis2SampleDocLitServiceStub( null, http://localhost:8080/axis2/services/Axis2SampleDocLitPortType http:/ / localhost:8080/axis2/services/Axis2SampleDocLitPortType http://localhost : 8080/axis2/services/Axis2SampleDocLitPortType ); XMLStreamReader r=null; //of course this must not be null!!! EchoStringParam p= EchoStringParam.Factory.parse (r); p.setEchoStringParam(Axis2 Echo);
Re: User Guide: Code generation for client
Thanks a lot Marcel for your findings. -Deepak On 8/8/06, Marcel Frehner [EMAIL PROTECTED] wrote: According tohttp://www.mail-archive.com/axis-user@ws.apache.org/msg16725.html , which Ihad overlooked before, we need to use the nightly snapshots. I still couldnot get it working. Now I definitely give up and wait for the next Releaseor at least for the next complete nightly build. Good luck for the rest or you!MarcelAt 18:01 07.08.2006 +0200, you wrote:Hey DeepakBy now I used to run the wsdl2java from Eclipse. Desperate as I am I triedthe command line version and got correct stub and skeleton code with the following command:wsdl2java -uri Axis2SampleDocLitService.wsdl -ss -sd -d xmlbeanswsdl2java -uri Axis2SampleDocLitService.wsdl -d xmlbeansThis will also generate a TypeSystemHolder.class which needs to be copiedto the IDE project manually(http://ws.apache.org/axis2/tools/1_0/CodegenToolReference.html). The next error I get is the following:org.apache.axis2.AxisFault: Data binding erroratorg.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:287)at org.apache.axis2.Axis2SampleDocLitServiceStub.echoString(Axis2SampleDocLitServiceStub.java:481)at org.Client.main(Client.java:25)No idea where that comes from:-( Maybe it's just the AXIS_HOME Good luck!MarcelMy client looks like this:package org;import org.apache.axis2.Axis2SampleDocLitServiceStub;import org.apache.axis2.userguide.xsd.EchoStringParamDocument ;import org.apache.axis2.userguide.xsd.EchoStringReturnDocument;public class Client {public static void main(String[] args){ try {//Create the stub by passing the AXIS_HOME and target EPR. //We pass null to the AXIS_HOME and hence the stub will use the current directory as the AXIS_HOMEAxis2SampleDocLitServiceStub stub= new Axis2SampleDocLitServiceStub(null, http://localhost:8080/axis2/services/Axis2SampleDocLitService);//Create the request document to be sent. EchoStringParamDocumentreqDoc= EchoStringParamDocument.Factory.newInstance();reqDoc.setEchoStringParam(Axis2 Echo);//invokes the Web service. EchoStringReturnDocument resDoc=stub.echoString(reqDoc);System.out.println(resDoc.getEchoStringReturn()); } catch (Exception e) { e.printStackTrace(); }}}At 11:28 07.08.2006 +0530, you wrote:I would really appreciate if Deepal, Derek or any active member can shedsome light on this problem. Thanks,DeepakOn 8/4/06, Marcel Frehnermailto:[EMAIL PROTECTED] [EMAIL PROTECTED] wrote:I gave it another try. But I could not get any further this time. I'vestillgot the following client, where stub.echoString() expects anEchoStringParam, which I don't have... package org;import org.apache.axis2.userguide.*;import org.apache.axis2.userguide.xsd.EchoStringParamDocument;import org.apache.axis2.userguide.xsd.EchoStringReturnDocument ;public class Client {public static void main(String[] args) {try {Axis2SampleDocLitServiceStub stub = new Axis2SampleDocLitServiceStub(null, http://localhost:8080/axis2/services/Axis2SampleDocLitService);EchoStringParamDocument reqDoc = EchoStringParamDocument.Factory .newInstance();reqDoc.setEchoStringParam(Axis2 Echo);EchoStringReturnDocument resDoc = stub.echoString(reqDoc);System.out.println(resDoc.getEchoStringReturn ());} catch (Exception e) {e.printStackTrace();}}}I would very much appreciate some help!Marcel At 22:21 03.08.2006 +0530, you wrote: Thanks Marcel for the inputs. As I am new to this Axis, so would not be able to comment. I would really appreciate if anyone give us the right direction to resolve this problem. Thanks, Deepak On 8/3/06, Marcel Frehner mailto: [EMAIL PROTECTED]mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi Deepak I've got the same problem and can't find a solution. Following up your thread about the EchoStringParam I would suggest something like the code below. But what ist the XMLStreamReader supposed to be? I mean, how can I create an EchoStringParam? Marcel *** import org.apache.axis2.userguide.Axis2SampleDocLitServiceStub; import org.apache.axis2.userguide.Axis2SampleDocLitServiceStub.EchoStringParam ; import org.apache.axis2.userguide.Axis2SampleDocLitServiceStub.EchoStringReturn; import javax.xml.stream.XMLStreamReader; public class Client { public static void main(String[] args) { try { Axis2SampleDocLitServiceStub stub = new Axis2SampleDocLitServiceStub( null, http://localhost:8080/axis2/services/Axis2SampleDocLitPortTypehttp:/ / localhost:8080/axis2/services/Axis2SampleDocLitPortType http://localhost : 8080/axis2/services/Axis2SampleDocLitPortType ); XMLStreamReader r=null; //of course this must not be null!!! EchoStringParam p= EchoStringParam.Factory.parse(r); p.setEchoStringParam(Axis2 Echo); EchoStringReturn resDoc = stub.echoString (p); System.out.println(resDoc.getEchoStringReturn()); } catch (Exception e) { e.printStackTrace(); } } } ***At 17:53 03.08.2006 +0530, you wrote: Hi Guys,This question has already been asked in the forum and I suppose I am the third person to ask this
Re: User Guide: Code generation for client
According to http://www.mail-archive.com/axis-user@ws.apache.org/msg16725.html, which I had overlooked before, we need to use the nightly snapshots. I still could not get it working. Now I definitely give up and wait for the next Release or at least for the next complete nightly build. Good luck for the rest or you! Marcel At 18:01 07.08.2006 +0200, you wrote: Hey Deepak By now I used to run the wsdl2java from Eclipse. Desperate as I am I tried the command line version and got correct stub and skeleton code with the following command: wsdl2java -uri Axis2SampleDocLitService.wsdl -ss -sd -d xmlbeans wsdl2java -uri Axis2SampleDocLitService.wsdl -d xmlbeans This will also generate a TypeSystemHolder.class which needs to be copied to the IDE project manually (http://ws.apache.org/axis2/tools/1_0/CodegenToolReference.html). The next error I get is the following: org.apache.axis2.AxisFault: Data binding error at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:287) at org.apache.axis2.Axis2SampleDocLitServiceStub.echoString(Axis2SampleDocLitServiceStub.java:481) at org.Client.main(Client.java:25) No idea where that comes from:-( Maybe it's just the AXIS_HOME Good luck! Marcel My client looks like this: package org; import org.apache.axis2.Axis2SampleDocLitServiceStub; import org.apache.axis2.userguide.xsd.EchoStringParamDocument; import org.apache.axis2.userguide.xsd.EchoStringReturnDocument; public class Client { public static void main(String[] args){ try { //Create the stub by passing the AXIS_HOME and target EPR. //We pass null to the AXIS_HOME and hence the stub will use the current directory as the AXIS_HOME Axis2SampleDocLitServiceStub stub= new Axis2SampleDocLitServiceStub(null, http://localhost:8080/axis2/services/Axis2SampleDocLitService;); //Create the request document to be sent. EchoStringParamDocument reqDoc= EchoStringParamDocument.Factory.newInstance(); reqDoc.setEchoStringParam(Axis2 Echo); //invokes the Web service. EchoStringReturnDocument resDoc=stub.echoString(reqDoc); System.out.println(resDoc.getEchoStringReturn()); } catch (Exception e) { e.printStackTrace(); } } } At 11:28 07.08.2006 +0530, you wrote: I would really appreciate if Deepal, Derek or any active member can shed some light on this problem. Thanks, Deepak On 8/4/06, Marcel Frehner mailto:[EMAIL PROTECTED][EMAIL PROTECTED] wrote: I gave it another try. But I could not get any further this time. I've still got the following client, where stub.echoString() expects an EchoStringParam, which I don't have... package org; import org.apache.axis2.userguide.*; import org.apache.axis2.userguide.xsd.EchoStringParamDocument; import org.apache.axis2.userguide.xsd.EchoStringReturnDocument ; public class Client { public static void main(String[] args) { try { Axis2SampleDocLitServiceStub stub = new Axis2SampleDocLitServiceStub( null, http://localhost:8080/axis2/services/Axis2SampleDocLitService;); EchoStringParamDocument reqDoc = EchoStringParamDocument.Factory .newInstance(); reqDoc.setEchoStringParam(Axis2 Echo); EchoStringReturnDocument resDoc = stub.echoString(reqDoc); System.out.println(resDoc.getEchoStringReturn()); } catch (Exception e) { e.printStackTrace(); } } } I would very much appreciate some help! Marcel At 22:21 03.08.2006 +0530, you wrote: Thanks Marcel for the inputs. As I am new to this Axis, so would not be able to comment. I would really appreciate if anyone give us the right direction to resolve this problem. Thanks, Deepak On 8/3/06, Marcel Frehner mailto:[EMAIL PROTECTED]mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi Deepak I've got the same problem and can't find a solution. Following up your thread about the EchoStringParam I would suggest something like the code below. But what ist the XMLStreamReader supposed to be? I mean, how can I create an EchoStringParam? Marcel *** import org.apache.axis2.userguide.Axis2SampleDocLitServiceStub; import org.apache.axis2.userguide.Axis2SampleDocLitServiceStub.EchoStringParam ; import org.apache.axis2.userguide.Axis2SampleDocLitServiceStub.EchoStringReturn; import javax.xml.stream.XMLStreamReader; public class Client { public static void main(String[] args) { try { Axis2SampleDocLitServiceStub stub = new Axis2SampleDocLitServiceStub( null, http://localhost:8080/axis2/services/Axis2SampleDocLitPortTypehttp:/ / localhost:8080/axis2/services/Axis2SampleDocLitPortType http://localhost : 8080/axis2/services/Axis2SampleDocLitPortType ); XMLStreamReader r=null; //of course this must not be null!!! EchoStringParam p=EchoStringParam.Factory.parse(r); p.setEchoStringParam(Axis2 Echo); EchoStringReturn resDoc = stub.echoString (p); System.out.println(resDoc.getEchoStringReturn()); } catch (Exception e) {
Re: User Guide: Code generation for client
I'm still working on the Axis2SampleDocLitService service from the tutorial. Using wsdl2java for the server side I get Axis2SampleDocLitServiceSkeleton which has a Method echoString(org.apache.axis2.userguide.xsd.EchoStringParamDocument param4). When generating the client I get Axis2SampleDocLitServiceStub which has a method echoString(org.apache.axis2.userguide.Axis2SampleDocLitServiceStub.EchoStringParam param10). Aren't those two methods supposed to ask for the same parameter types? When I execute the client, I get the following exception: java.lang.RuntimeException: java.lang.NullPointerException at org.apache.axis2.userguide.Axis2SampleDocLitServiceStub.fromOM(Axis2SampleDocLitServiceStub.java:2196) at org.apache.axis2.userguide.Axis2SampleDocLitServiceStub.echoString(Axis2SampleDocLitServiceStub.java:489) at org.Client.main(Client.java:21) Caused by: java.lang.NullPointerException at org.apache.axis2.userguide.Axis2SampleDocLitServiceStub.fromOM(Axis2SampleDocLitServiceStub.java:2180) ... 2 more Thanks for your help Marcel At 11:28 07.08.2006 +0530, you wrote: I would really appreciate if Deepal, Derek or any active member can shed some light on this problem. Thanks, Deepak On 8/4/06, Marcel Frehner mailto:[EMAIL PROTECTED][EMAIL PROTECTED] wrote: I gave it another try. But I could not get any further this time. I've still got the following client, where stub.echoString() expects an EchoStringParam, which I don't have... package org; import org.apache.axis2.userguide.*; import org.apache.axis2.userguide.xsd.EchoStringParamDocument; import org.apache.axis2.userguide.xsd.EchoStringReturnDocument ; public class Client { public static void main(String[] args) { try { Axis2SampleDocLitServiceStub stub = new Axis2SampleDocLitServiceStub( null, http://localhost:8080/axis2/services/Axis2SampleDocLitService;); EchoStringParamDocument reqDoc = EchoStringParamDocument.Factory .newInstance(); reqDoc.setEchoStringParam(Axis2 Echo); EchoStringReturnDocument resDoc = stub.echoString(reqDoc); System.out.println(resDoc.getEchoStringReturn()); } catch (Exception e) { e.printStackTrace(); } } } I would very much appreciate some help! Marcel At 22:21 03.08.2006 +0530, you wrote: Thanks Marcel for the inputs. As I am new to this Axis, so would not be able to comment. I would really appreciate if anyone give us the right direction to resolve this problem. Thanks, Deepak On 8/3/06, Marcel Frehner mailto:[EMAIL PROTECTED]mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi Deepak I've got the same problem and can't find a solution. Following up your thread about the EchoStringParam I would suggest something like the code below. But what ist the XMLStreamReader supposed to be? I mean, how can I create an EchoStringParam? Marcel *** import org.apache.axis2.userguide.Axis2SampleDocLitServiceStub; import org.apache.axis2.userguide.Axis2SampleDocLitServiceStub.EchoStringParam ; import org.apache.axis2.userguide.Axis2SampleDocLitServiceStub.EchoStringReturn; import javax.xml.stream.XMLStreamReader; public class Client { public static void main(String[] args) { try { Axis2SampleDocLitServiceStub stub = new Axis2SampleDocLitServiceStub( null, http://localhost:8080/axis2/services/Axis2SampleDocLitPortTypehttp:// localhost:8080/axis2/services/Axis2SampleDocLitPortType http://localhost: 8080/axis2/services/Axis2SampleDocLitPortType ); XMLStreamReader r=null; //of course this must not be null!!! EchoStringParam p=EchoStringParam.Factory.parse(r); p.setEchoStringParam(Axis2 Echo); EchoStringReturn resDoc = stub.echoString (p); System.out.println(resDoc.getEchoStringReturn()); } catch (Exception e) { e.printStackTrace(); } } } *** At 17:53 03.08.2006 +0530, you wrote: Hi Guys, This question has already been asked in the forum and I suppose I am the third person to ask this question. But no response has come so far to rectify this problem. Following is the problem: I am facing some problem creating client for the example mentioned in the user guide. http://ws.apache.org/axis2/1_0/userguide3.htmlhttp://ws.apache.org/ axis2/1_0/userguide3.htmlhttp://ws.apache.org/axi s2/1_0/userguide3.html http://ws.apache.org/axis2/1_0/userguide3.html#Writing_Web_Service_Clients_using_Code_Generation_with_Data_Binding_Supporthttp://ws.apache.org/axis2/1_0/userguide3.html#Writing_Web_Service_Clients_using_Code_Generation_with_Data_Binding_Support WSDL2Java is not generating Axis2SampleDocLitPortTypeStub.java instead it is generating Axis2SampleDocLitServiceStub.java and it's Callback Handler. Following is the client which I have written but it is not getting compiled as echoString method expects EchoStringParam not EchoStringParamDocument. EchoStringReturnDocument resDoc = stub.echoString(reqDoc); public class Client { public static void main(String[] args) { try { Axis2SampleDocLitServiceStub stub = new Axis2SampleDocLitServiceStub(
Re: User Guide: Code generation for client
Hey Deepak By now I used to run the wsdl2java from Eclipse. Desperate as I am I tried the command line version and got correct stub and skeleton code with the following command: wsdl2java -uri Axis2SampleDocLitService.wsdl -ss -sd -d xmlbeans wsdl2java -uri Axis2SampleDocLitService.wsdl -d xmlbeans This will also generate a TypeSystemHolder.class which needs to be copied to the IDE project manually (http://ws.apache.org/axis2/tools/1_0/CodegenToolReference.html). The next error I get is the following: org.apache.axis2.AxisFault: Data binding error at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:287) at org.apache.axis2.Axis2SampleDocLitServiceStub.echoString(Axis2SampleDocLitServiceStub.java:481) at org.Client.main(Client.java:25) No idea where that comes from:-( Maybe it's just the AXIS_HOME Good luck! Marcel My client looks like this: package org; import org.apache.axis2.Axis2SampleDocLitServiceStub; import org.apache.axis2.userguide.xsd.EchoStringParamDocument; import org.apache.axis2.userguide.xsd.EchoStringReturnDocument; public class Client { public static void main(String[] args){ try { //Create the stub by passing the AXIS_HOME and target EPR. //We pass null to the AXIS_HOME and hence the stub will use the current directory as the AXIS_HOME Axis2SampleDocLitServiceStub stub= new Axis2SampleDocLitServiceStub(null, http://localhost:8080/axis2/services/Axis2SampleDocLitService;); //Create the request document to be sent. EchoStringParamDocument reqDoc= EchoStringParamDocument.Factory.newInstance(); reqDoc.setEchoStringParam(Axis2 Echo); //invokes the Web service. EchoStringReturnDocument resDoc=stub.echoString(reqDoc); System.out.println(resDoc.getEchoStringReturn()); } catch (Exception e) { e.printStackTrace(); } } } At 11:28 07.08.2006 +0530, you wrote: I would really appreciate if Deepal, Derek or any active member can shed some light on this problem. Thanks, Deepak On 8/4/06, Marcel Frehner mailto:[EMAIL PROTECTED][EMAIL PROTECTED] wrote: I gave it another try. But I could not get any further this time. I've still got the following client, where stub.echoString() expects an EchoStringParam, which I don't have... package org; import org.apache.axis2.userguide.*; import org.apache.axis2.userguide.xsd.EchoStringParamDocument; import org.apache.axis2.userguide.xsd.EchoStringReturnDocument ; public class Client { public static void main(String[] args) { try { Axis2SampleDocLitServiceStub stub = new Axis2SampleDocLitServiceStub( null, http://localhost:8080/axis2/services/Axis2SampleDocLitService;); EchoStringParamDocument reqDoc = EchoStringParamDocument.Factory .newInstance(); reqDoc.setEchoStringParam(Axis2 Echo); EchoStringReturnDocument resDoc = stub.echoString(reqDoc); System.out.println(resDoc.getEchoStringReturn()); } catch (Exception e) { e.printStackTrace(); } } } I would very much appreciate some help! Marcel At 22:21 03.08.2006 +0530, you wrote: Thanks Marcel for the inputs. As I am new to this Axis, so would not be able to comment. I would really appreciate if anyone give us the right direction to resolve this problem. Thanks, Deepak On 8/3/06, Marcel Frehner mailto:[EMAIL PROTECTED]mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi Deepak I've got the same problem and can't find a solution. Following up your thread about the EchoStringParam I would suggest something like the code below. But what ist the XMLStreamReader supposed to be? I mean, how can I create an EchoStringParam? Marcel *** import org.apache.axis2.userguide.Axis2SampleDocLitServiceStub; import org.apache.axis2.userguide.Axis2SampleDocLitServiceStub.EchoStringParam ; import org.apache.axis2.userguide.Axis2SampleDocLitServiceStub.EchoStringReturn; import javax.xml.stream.XMLStreamReader; public class Client { public static void main(String[] args) { try { Axis2SampleDocLitServiceStub stub = new Axis2SampleDocLitServiceStub( null, http://localhost:8080/axis2/services/Axis2SampleDocLitPortTypehttp:// localhost:8080/axis2/services/Axis2SampleDocLitPortType http://localhost: 8080/axis2/services/Axis2SampleDocLitPortType ); XMLStreamReader r=null; //of course this must not be null!!! EchoStringParam p=EchoStringParam.Factory.parse(r); p.setEchoStringParam(Axis2 Echo); EchoStringReturn resDoc = stub.echoString (p); System.out.println(resDoc.getEchoStringReturn()); } catch (Exception e) { e.printStackTrace(); } } } *** At 17:53 03.08.2006 +0530, you wrote: Hi Guys, This question has already been asked in the forum and I suppose I am the third person to ask this question. But no response has come so far to rectify this problem. Following is the problem: I am facing some problem creating client for the example mentioned
Re: User Guide: Code generation for client
I would really appreciate if Deepal, Derek or any active member can shed some light on this problem. Thanks, Deepak On 8/4/06, Marcel Frehner [EMAIL PROTECTED] wrote: I gave it another try. But I could not get any further this time. I'vestillgot the following client, where stub.echoString() expects anEchoStringParam, which I don't have...package org;import org.apache.axis2.userguide.*;import org.apache.axis2.userguide.xsd.EchoStringParamDocument;import org.apache.axis2.userguide.xsd.EchoStringReturnDocument ;public class Client {public static void main(String[] args) {try {Axis2SampleDocLitServiceStub stub = new Axis2SampleDocLitServiceStub(null, http://localhost:8080/axis2/services/Axis2SampleDocLitService);EchoStringParamDocument reqDoc = EchoStringParamDocument.Factory.newInstance();reqDoc.setEchoStringParam(Axis2 Echo); EchoStringReturnDocument resDoc = stub.echoString(reqDoc);System.out.println(resDoc.getEchoStringReturn());} catch (Exception e) {e.printStackTrace();}}}I would very much appreciate some help! MarcelAt 22:21 03.08.2006 +0530, you wrote:Thanks Marcel for the inputs. As I am new to this Axis, so would not beable to comment.I would really appreciate if anyone give us the right direction to resolve this problem.Thanks,DeepakOn 8/3/06, Marcel Frehnermailto:[EMAIL PROTECTED] [EMAIL PROTECTED] wrote:Hi DeepakI've got the same problem and can't find a solution. Following up yourthread about the EchoStringParam I would suggest something like the codebelow. But what ist the XMLStreamReader supposed to be? I mean, how can I create an EchoStringParam?Marcel***import org.apache.axis2.userguide.Axis2SampleDocLitServiceStub;importorg.apache.axis2.userguide.Axis2SampleDocLitServiceStub.EchoStringParam ;importorg.apache.axis2.userguide.Axis2SampleDocLitServiceStub.EchoStringReturn;import javax.xml.stream.XMLStreamReader;public class Client {public static void main(String[] args) { try {Axis2SampleDocLitServiceStub stub = new Axis2SampleDocLitServiceStub(null,http://localhost:8080/axis2/services/Axis2SampleDocLitPortType http://localhost:8080/axis2/services/Axis2SampleDocLitPortType);XMLStreamReader r=null; //of course this must not be null!!! EchoStringParam p=EchoStringParam.Factory.parse(r);p.setEchoStringParam(Axis2 Echo);EchoStringReturn resDoc = stub.echoString (p);System.out.println(resDoc.getEchoStringReturn()); } catch (Exception e) {e.printStackTrace();}}}***At 17:53 03.08.2006 +0530, you wrote: Hi Guys, This question has already been asked in the forum and I suppose I am the third person to ask this question. But no response has come so far to rectify this problem. Following is the problem: I am facing some problem creating client for the example mentioned in the user guide. http://ws.apache.org/axis2/1_0/userguide3.htmlhttp://ws.apache.org/axi s2/1_0/userguide3.html http://ws.apache.org/axis2/1_0/userguide3.html#Writing_Web_Service_Clients_using_Code_Generation_with_Data_Binding_Support WSDL2Java is not generating Axis2SampleDocLitPortTypeStub.java instead it is generating Axis2SampleDocLitServiceStub.java and it's Callback Handler. Following is the client which I have written but it is not getting compiled as echoString method expects EchoStringParam not EchoStringParamDocument. EchoStringReturnDocument resDoc = stub.echoString(reqDoc);public class Client { public static void main(String[] args) { try { Axis2SampleDocLitServiceStub stub = new Axis2SampleDocLitServiceStub( null, http://localhost:8080/axis2/services/Axis2SampleDocLitPortTypehttp://localhost:8080/axis2/services/Axis2SampleDocLitPortType ); EchoStringParamDocument reqDoc = EchoStringParamDocument.Factory .newInstance(); reqDoc.setEchoStringParam( Axis2 Echo); EchoStringReturnDocument resDoc = stub.echoString(reqDoc); System. out.println(resDoc.getEchoStringReturn()); } catch (Exception e) { e.printStackTrace(); } } Looking forward for your response. Thanks, Deepak --dipl. geogr. Marcel FrehnerWissenschaftlicher MitarbeiterEidgenössische Forschungsanstalt für Wald, Schnee und Landschaft WSLAbteilung LandschaftsinventurenZürcherstrasse 111 8903 BirmensdorfTel. +41-44-739 26 83mailto:[EMAIL PROTECTED][EMAIL PROTECTED] http://www.wsl.ch-To unsubscribe, e-mail:mailto: [EMAIL PROTECTED][EMAIL PROTECTED]For additional commands, e-mail:mailto: [EMAIL PROTECTED][EMAIL PROTECTED]-- \|/ | ~ ~ | (- 0 0 -)#--oOOo--(_)--oOOo---#It's better to burn out, than to fade away. Oooo.#--.oooO-()--# () )/\--dipl. geogr. Marcel FrehnerWissenschaftlicher MitarbeiterEidgenössische Forschungsanstalt für Wald, Schnee und Landschaft WSL Abteilung LandschaftsinventurenZürcherstrasse 1118903 BirmensdorfTel. +41-44-739 26 83[EMAIL PROTECTED]http://www.wsl.ch
Re: User Guide: Code generation for client
I gave it another try. But I could not get any further this time. I've still got the following client, where stub.echoString() expects an EchoStringParam, which I don't have... package org; import org.apache.axis2.userguide.*; import org.apache.axis2.userguide.xsd.EchoStringParamDocument; import org.apache.axis2.userguide.xsd.EchoStringReturnDocument; public class Client { public static void main(String[] args) { try { Axis2SampleDocLitServiceStub stub = new Axis2SampleDocLitServiceStub( null, http://localhost:8080/axis2/services/Axis2SampleDocLitService;); EchoStringParamDocument reqDoc = EchoStringParamDocument.Factory .newInstance(); reqDoc.setEchoStringParam(Axis2 Echo); EchoStringReturnDocument resDoc = stub.echoString(reqDoc); System.out.println(resDoc.getEchoStringReturn()); } catch (Exception e) { e.printStackTrace(); } } } I would very much appreciate some help! Marcel At 22:21 03.08.2006 +0530, you wrote: Thanks Marcel for the inputs. As I am new to this Axis, so would not be able to comment. I would really appreciate if anyone give us the right direction to resolve this problem. Thanks, Deepak On 8/3/06, Marcel Frehner mailto:[EMAIL PROTECTED][EMAIL PROTECTED] wrote: Hi Deepak I've got the same problem and can't find a solution. Following up your thread about the EchoStringParam I would suggest something like the code below. But what ist the XMLStreamReader supposed to be? I mean, how can I create an EchoStringParam? Marcel *** import org.apache.axis2.userguide.Axis2SampleDocLitServiceStub; import org.apache.axis2.userguide.Axis2SampleDocLitServiceStub.EchoStringParam ; import org.apache.axis2.userguide.Axis2SampleDocLitServiceStub.EchoStringReturn; import javax.xml.stream.XMLStreamReader; public class Client { public static void main(String[] args) { try { Axis2SampleDocLitServiceStub stub = new Axis2SampleDocLitServiceStub( null, http://localhost:8080/axis2/services/Axis2SampleDocLitPortTypehttp://localhost:8080/axis2/services/Axis2SampleDocLitPortType ); XMLStreamReader r=null; //of course this must not be null!!! EchoStringParam p=EchoStringParam.Factory.parse(r); p.setEchoStringParam(Axis2 Echo); EchoStringReturn resDoc = stub.echoString (p); System.out.println(resDoc.getEchoStringReturn()); } catch (Exception e) { e.printStackTrace(); } } } *** At 17:53 03.08.2006 +0530, you wrote: Hi Guys, This question has already been asked in the forum and I suppose I am the third person to ask this question. But no response has come so far to rectify this problem. Following is the problem: I am facing some problem creating client for the example mentioned in the user guide. http://ws.apache.org/axis2/1_0/userguide3.htmlhttp://ws.apache.org/axi s2/1_0/userguide3.html http://ws.apache.org/axis2/1_0/userguide3.html#Writing_Web_Service_Clients_using_Code_Generation_with_Data_Binding_Support WSDL2Java is not generating Axis2SampleDocLitPortTypeStub.java instead it is generating Axis2SampleDocLitServiceStub.java and it's Callback Handler. Following is the client which I have written but it is not getting compiled as echoString method expects EchoStringParam not EchoStringParamDocument. EchoStringReturnDocument resDoc = stub.echoString(reqDoc); public class Client { public static void main(String[] args) { try { Axis2SampleDocLitServiceStub stub = new Axis2SampleDocLitServiceStub( null, http://localhost:8080/axis2/services/Axis2SampleDocLitPortTypehttp://localhost:8080/axis2/services/Axis2SampleDocLitPortType; ); EchoStringParamDocument reqDoc = EchoStringParamDocument.Factory .newInstance(); reqDoc.setEchoStringParam( Axis2 Echo); EchoStringReturnDocument resDoc = stub.echoString(reqDoc); System. out.println(resDoc.getEchoStringReturn()); } catch (Exception e) { e.printStackTrace(); } } Looking forward for your response. Thanks, Deepak -- dipl. geogr. Marcel Frehner Wissenschaftlicher Mitarbeiter Eidgenössische Forschungsanstalt für Wald, Schnee und Landschaft WSL Abteilung Landschaftsinventuren Zürcherstrasse 111 8903 Birmensdorf Tel. +41-44-739 26 83 mailto:[EMAIL PROTECTED][EMAIL PROTECTED] http://www.wsl.ch - To unsubscribe, e-mail: mailto:[EMAIL PROTECTED][EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED][EMAIL PROTECTED] -- \|/ | ~ ~ | (- 0 0 -) #--oOOo--(_)--oOOo---# It's better to burn out, than to fade away. Oooo. #--.oooO-()--# () ) / \ -- dipl. geogr. Marcel Frehner Wissenschaftlicher Mitarbeiter Eidgenössische Forschungsanstalt für Wald, Schnee und Landschaft WSL Abteilung Landschaftsinventuren Zürcherstrasse 111 8903 Birmensdorf Tel.
Re: User Guide: Code generation for client
Hi Deepak I've got the same problem and can't find a solution. Following up your thread about the EchoStringParam I would suggest something like the code below. But what ist the XMLStreamReader supposed to be? I mean, how can I create an EchoStringParam? Marcel *** import org.apache.axis2.userguide.Axis2SampleDocLitServiceStub; import org.apache.axis2.userguide.Axis2SampleDocLitServiceStub.EchoStringParam; import org.apache.axis2.userguide.Axis2SampleDocLitServiceStub.EchoStringReturn; import javax.xml.stream.XMLStreamReader; public class Client { public static void main(String[] args) { try { Axis2SampleDocLitServiceStub stub = new Axis2SampleDocLitServiceStub( null, http://localhost:8080/axis2/services/Axis2SampleDocLitPortType;); XMLStreamReader r=null; //of course this must not be null!!! EchoStringParam p=EchoStringParam.Factory.parse(r); p.setEchoStringParam(Axis2 Echo); EchoStringReturn resDoc = stub.echoString(p); System.out.println(resDoc.getEchoStringReturn()); } catch (Exception e) { e.printStackTrace(); } } } *** At 17:53 03.08.2006 +0530, you wrote: Hi Guys, This question has already been asked in the forum and I suppose I am the third person to ask this question. But no response has come so far to rectify this problem. Following is the problem: I am facing some problem creating client for the example mentioned in the user guide. http://ws.apache.org/axis2/1_0/userguide3.htmlhttp://ws.apache.org/axis2/1_0/userguide3.html#Writing_Web_Service_Clients_using_Code_Generation_with_Data_Binding_Support WSDL2Java is not generating Axis2SampleDocLitPortTypeStub.java instead it is generating Axis2SampleDocLitServiceStub.java and it's Callback Handler. Following is the client which I have written but it is not getting compiled as echoString method expects EchoStringParam not EchoStringParamDocument. EchoStringReturnDocument resDoc = stub.echoString(reqDoc); public class Client { public static void main(String[] args) { try { Axis2SampleDocLitServiceStub stub = new Axis2SampleDocLitServiceStub( null, http://localhost:8080/axis2/services/Axis2SampleDocLitPortTypehttp://localhost:8080/axis2/services/Axis2SampleDocLitPortType; ); EchoStringParamDocument reqDoc = EchoStringParamDocument.Factory .newInstance(); reqDoc.setEchoStringParam( Axis2 Echo); EchoStringReturnDocument resDoc = stub.echoString(reqDoc); System. out.println(resDoc.getEchoStringReturn()); } catch (Exception e) { e.printStackTrace(); } } Looking forward for your response. Thanks, Deepak -- dipl. geogr. Marcel Frehner Wissenschaftlicher Mitarbeiter Eidgenössische Forschungsanstalt für Wald, Schnee und Landschaft WSL Abteilung Landschaftsinventuren Zürcherstrasse 111 8903 Birmensdorf Tel. +41-44-739 26 83 [EMAIL PROTECTED] http://www.wsl.ch - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: User Guide: Code generation for client
Thanks Marcel for the inputs. As I am new to this Axis, so would not be able to comment. I would really appreciate if anyone give us the right direction to resolve this problem. Thanks, Deepak On 8/3/06, Marcel Frehner [EMAIL PROTECTED] wrote: Hi DeepakI've got the same problem and can't find a solution. Following up yourthread about the EchoStringParam I would suggest something like the code below. But what ist the XMLStreamReader supposed to be? I mean, how can Icreate an EchoStringParam?Marcel***import org.apache.axis2.userguide.Axis2SampleDocLitServiceStub;import org.apache.axis2.userguide.Axis2SampleDocLitServiceStub.EchoStringParam ;importorg.apache.axis2.userguide.Axis2SampleDocLitServiceStub.EchoStringReturn;import javax.xml.stream.XMLStreamReader;public class Client {public static void main(String[] args) {try { Axis2SampleDocLitServiceStub stub = new Axis2SampleDocLitServiceStub(null,http://localhost:8080/axis2/services/Axis2SampleDocLitPortType );XMLStreamReader r=null; //of course this must not be null!!!EchoStringParam p=EchoStringParam.Factory.parse(r);p.setEchoStringParam(Axis2 Echo);EchoStringReturn resDoc = stub.echoString (p);System.out.println(resDoc.getEchoStringReturn());} catch (Exception e) {e.printStackTrace();}}}***At 17:53 03.08.2006 +0530, you wrote:Hi Guys,This question has already been asked in the forum and I suppose I am the third person to ask this question. But no response has come so far torectify this problem. Following is the problem:I am facing some problem creating client for the example mentioned in the user guide.http://ws.apache.org/axis2/1_0/userguide3.html http://ws.apache.org/axis2/1_0/userguide3.html#Writing_Web_Service_Clients_using_Code_Generation_with_Data_Binding_SupportWSDL2Java is not generating Axis2SampleDocLitPortTypeStub.java instead it is generating Axis2SampleDocLitServiceStub.java and it's Callback Handler.Following is the client which I have written but it is not gettingcompiled as echoString method expects EchoStringParam not EchoStringParamDocument.EchoStringReturnDocument resDoc = stub.echoString(reqDoc);publicclass Client {public static void main(String[] args) { try {Axis2SampleDocLitServiceStubstub = new Axis2SampleDocLitServiceStub(null, http://localhost:8080/axis2/services/Axis2SampleDocLitPortTypehttp://localhost:8080/axis2/services/Axis2SampleDocLitPortType); EchoStringParamDocumentreqDoc = EchoStringParamDocument.Factory.newInstance();reqDoc.setEchoStringParam(Axis2 Echo);EchoStringReturnDocument resDoc = stub.echoString(reqDoc);System.out.println(resDoc.getEchoStringReturn());}catch (Exception e) {e.printStackTrace();} }Looking forward for your response.Thanks,Deepak--dipl. geogr. Marcel FrehnerWissenschaftlicher MitarbeiterEidgenössische Forschungsanstalt für Wald, Schnee und Landschaft WSL Abteilung LandschaftsinventurenZürcherstrasse 1118903 BirmensdorfTel. +41-44-739 26 83[EMAIL PROTECTED]http://www.wsl.ch -To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]-- \|/| ~ ~ | (- 0 0 -)#--oOOo--(_)--oOOo---# It's better to burn out, than to fade away.Oooo.#--.oooO-()--# () )/ \