Re: [Axis2] problem with WSDL2Java generated stubs and databinding

2005-12-27 Thread iksrazal
Nikola, 

This might be easier for you - it works for me using the .93 release. 

 Options options = stub._getClientOptions();
  options.setAction("http://smartSWANS/smartLogin";);

Where the relevant section of the wsdl is: 

 
  http://smartSWANS/smartLogin"; 
style="document" />
  

  
  

  


Or you could try the latest nightly: 

http://cvs.apache.org/dist/axis2/nightly/

HTH,
iksrazal

Em Terça 27 Dezembro 2005 14:14, o Nikola Zifra escreveu:
> Hi iksrazal and Chintaka,
>   this is the part of the stub code  generated  by the  0.92  version of
> the WSDL2Java  tool:
>
>org.apache.axis2.clientapi.Call _call = new
> org.apache.axis2.clientapi.Call(_serviceContext);
> _call.setTransportInfo(this.senderTransport,this.listenerTransport,this.use
>SeparateListener); _call.setDoREST(this.doRest);
>
> org.apache.axis2.context.MessageContext _messageContext = 
> getMessageContext(); _call.setTo(this.toEPR);
>   _call.setSoapAction("echoString");
>
>   And this is the part generated by 0.93 version of WSDL2Java tool:
>
> org.apache.axis2.client.Call _call = new 
> org.apache.axis2.client.Call(_serviceContext);
> _call.setClientOptions(_clientOptions);
> org.apache.axis2.context.MessageContext _messageContext = 
> getMessageContext(); if(_clientOptions.getSoapAction() == null) {
>
> }
>
>if(_clientOptions.getAction() == null) {
>
>}
>
>   Notice that two different Call classes with different APIs are used in 
> 0.92 and 0.93 version of the generated stub.You can't add line 
> _call.setSoapAction("echoString")  to the 0.93 version gen code  because
> the org.apache.axis2.client.Call used in the 0.93 does not have  method
> setSoapAction() . You can just use 
> _clientOptions.setSoapAction("echoString") but it seems that it does  not
> resolve my issue, because I am still getting the exception I've complained
> about.
>
>   When I modify the 0.93 version code like this i am still getting the
> exception:
>
>   rg.apache.axis2.client.Call _call = new
> org.apache.axis2.client.Call(_serviceContext);
> _call.setClientOptions(_clientOptions);
> org.apache.axis2.context.MessageContext _messageContext = 
> getMessageContext(); if(_clientOptions.getSoapAction() == null) {
>  System.out.println("\n\n\n>>> SETTING  SOAP ACTION");
>  _clientOptions.setSoapAction("echoString");
>   }
>
>   org.apache.axis2.AxisFault: org.apache.axis2.AxisFault: Operation Not 
> found EPR is 
> http://localhost:8080/axis2/services/Axis2SampleDocLitPortType and WSA 
> Action = at
> org.apache.axis2.engine.DispatchingChecker.invoke(DispatchingChecker.java:7
>0) at org.apache.axis2.engine.Phase.invoke(Phase.java:167)
>   at
> org.apache.axis2.engine.AxisEngine.invokePhases(AxisEngine.java:443) at
> org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:137)
>
>   When I modify the 0.93 code in the following  manner :
>
>   org.apache.axis2.client.Call _call = new
> org.apache.axis2.client.Call(_serviceContext);
> _call.setClientOptions(_clientOptions);
>
> org.apache.axis2.context.MessageContext _messageContext = 
> getMessageContext(); _clientOptions.setSoapAction("echoString");
>if(_clientOptions.getSoapAction() == null) {
>
>
> }
>
>if(_clientOptions.getAction() == null) {
>
>}
>   I got the the following exception:
>
>   org.apache.axis2.AxisFault: null; nested exception is:
>   java.lang.NullPointerException
>   at org.apache.axis2.AxisFault.makeFault(AxisFault.java:190)
>   at 
> org.apache.axis2.userguide.Axis2SampleDocLitPortTypeMessageReceiver.invokeB
>usinessLogic(Axis2SampleDocLitPortTypeMessageReceiver.java:120) at 
> org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive(Abstrac
>tInOutSyncMessageReceiver.java:36) 
>   Caused by: java.lang.NullPointerException
>   at 
> org.apache.axis2.userguide.databinding.Axis2SampleDocLitPortTypeechoStringD
>atabindingSupporter.toOM(Axis2SampleDocLitPortTypeechoStringDatabindingSuppo
>rter.java:34) at 
> org.apache.axis2.userguide.Axis2SampleDocLitPortTypeMessageReceiver.invokeB
>usinessLogic(Axis2SampleDocLitPortTypeMessageReceiver.java:106) ... 20 more
>
>   Could you pls. be more specific what part of the generated code should I
> modify and how?
>
>   Regards,
>   Nikola
>
>
>
>
>
>
> Eran Chinthaka <[EMAIL PROTECTED]> wrote:  -BEGIN PGP
> SIGNED MESSAGE- Hash: SHA1
>
>   Nikola, the iksrazal's method will fix the problem, BUT ..
>   I should accept that its a bug in 0.93 release, which is now fixed in
>   current SVN head.
>
>   - -- Chinthaka
>
>   iksrazal wrote:
>   > Nikola,
>   >
>   >
>   >
>   > Try following this thread - worked for me when I had a similiar
>   >
>   > problem:
>
>   http://marc.theaimsgroup.com/?l=axis-user&m=

Re: [Axis2] problem with WSDL2Java generated stubs and databinding

2005-12-27 Thread Nikola Zifra
Hi iksrazal and Chintaka,  this is the part of the stub code  generated  by the  0.92  version of the WSDL2Java  tool: org.apache.axis2.clientapi.Call _call = new org.apache.axis2.clientapi.Call(_serviceContext);       _call.setTransportInfo(this.senderTransport,this.listenerTransport,this.useSeparateListener);      _call.setDoREST(this.doRest);          org.apache.axis2.context.MessageContext _messageContext =  getMessageContext();      _call.setTo(this.toEPR);      _call.setSoapAction("echoString");And this is the part generated by 0.93 version of WSDL2Java tool:  
  
           org.apache.axis2.client.Call _call = new  org.apache.axis2.client.Call(_serviceContext);   _call.setClientOptions(_clientOptions);    org.apache.axis2.context.MessageContext _messageContext =  getMessageContext();        if(_clientOptions.getSoapAction() == null) {                    } if(_clientOptions.getAction() == null) {                 
 ; 
  }Notice that two different Call classes with different APIs are used in  0.92 and 0.93 version of the generated stub.You can't add line  _call.setSoapAction("echoString")  to the 0.93 version gen code  because the org.apache.axis2.client.Call used in the 0.93 does not have  method setSoapAction() . You can just use  _clientOptions.setSoapAction("echoString") but it seems that it does  not resolve my issue, because I am still getting  the exception I've complained about.When I modify the 0.93 version code like this i am still getting the exception:rg.apache.axis2.client.Call _call = new org.apache.axis2.client.Call(_serviceContext); _call.setClientOptions(_clientOptions);    org.apache.axis2.context.MessageContext _messageContext =  getMessageContext(); 
 if(_clientOptions.getSoapAction() == null) {                 System.out.println("\n\n\n>>> SETTING  SOAP ACTION");                 _clientOptions.setSoapAction("echoString");  }org.apache.axis2.AxisFault: org.apache.axis2.AxisFault: Operation Not  found EPR is  http://localhost:8080/axis2/services/Axis2SampleDocLitPortType and WSA  Action = "">      at org.apache.axis2.engine.DispatchingChecker.invoke(DispatchingChecker.java:70)      at org.apache.axis2.engine.Phase.invoke(Phase.java:167)      at org.apache.axis2.engine.AxisEngine.invokePhases(AxisEngine.java:443)      at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:137)When I modify the 0.93 code in the following  manner :   
 org.apache.axis2.client.Call _call = new org.apache.axis2.client.Call(_serviceContext);   _call.setClientOptions(_clientOptions);    org.apache.axis2.context.MessageContext _messageContext =  getMessageContext();   _clientOptions.setSoapAction("echoString");   if(_clientOptions.getSoapAction() == null) {                                  
      } if(_clientOptions.getAction() == null) {                    }  I got the the following exception:org.apache.axis2.AxisFault: null; nested exception is:       java.lang.NullPointerException      at org.apache.axis2.AxisFault.makeFault(AxisFault.java:190)      at  org.apache.axis2.userguide.Axis2SampleDocLitPortTypeMessageReceiver.invokeBusinessLogic(Axis2SampleDocLitPortTypeMessageReceiver.java:120)      at  org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive(AbstractInOutSyncMessageReceiver.java:36)    Caused by: java.lang.NullPointerException      at 
 org.apache.axis2.userguide.databinding.Axis2SampleDocLitPortTypeechoStringDatabindingSupporter.toOM(Axis2SampleDocLitPortTypeechoStringDatabindingSupporter.java:34)      at  org.apache.axis2.userguide.Axis2SampleDocLitPortTypeMessageReceiver.invokeBusinessLogic(Axis2SampleDocLitPortTypeMessageReceiver.java:106)      ... 20 moreCould you pls. be more specific what part of the generated code should I modify and how?Regards,  Nikola  Eran Chinthaka <[EMAIL PROTECTED]> wrote:  -BEGIN PGP SIGNED MESSAGE-   Hash: SHA1      Nikola, the iksrazal's method will fix the problem, BUT ..  I should accept that its a bug in 0.93 re
 lease,
 which is now fixed in  current SVN head.- -- Chinthakaiksrazal wrote:> Nikola,  >   > Try following this thread - worked for me when I had a similiar  > problem:  >   >  http://marc.theaimsgroup.com/?l=axis-user&m=113474706726344&w=2  >   > HTH, iksrazal  >   > Em Terça 27 Dezembro 2005 08:48, o Nikola Zifra escreveu:  >   >> Hi I am getting following exception when I try to run the  code  >> generated by WSDL2Java tool.  >>   >> - Invoking Handler 'AddressingOutHandler' in Phase  'MessageOut' -  >> Build the OMElelment EnvelopeBy the StaxSOAPModelBuilder -  >> Starting Process
  SOAP
 1.1 message - Build the OMElelment  HeaderBy  >> the StaxSOAPModelBuild

Re: [Axis2] problem with WSDL2Java generated stubs and databinding

2005-12-27 Thread Eran Chinthaka




-BEGIN PGP SIGNED MESSAGE- 
Hash: SHA1 
 
Nikola, the iksrazal's method will fix the problem, BUT ..
I should accept that its a bug in 0.93 release, which is now fixed in
current SVN head.

- -- Chinthaka

iksrazal wrote:

> Nikola,
> 
> Try following this thread - worked for me when I had a similiar
> problem:
> 
>
http://marc.theaimsgroup.com/?l=axis-user&m=113474706726344&w=2
> 
> HTH, iksrazal
> 
> Em Terça 27 Dezembro 2005 08:48, o Nikola Zifra escreveu:
> 
>> Hi I am getting following exception when I try to run the
code
>> generated by WSDL2Java tool.
>> 
>> - Invoking Handler 'AddressingOutHandler' in Phase
'MessageOut' -
>> Build the OMElelment EnvelopeBy the StaxSOAPModelBuilder -
>> Starting Process SOAP 1.1 message - Build the OMElelment
HeaderBy
>> the StaxSOAPModelBuilder - Build the OMElelment BodyBy the
>> StaxSOAPModelBuilder - Invoking Handler
'AddressingInHandler' in
>> Phase 'PreDispatch' org.apache.axis2.AxisFault:
>> org.apache.axis2.AxisFault: Operation Not found EPR is 
>>
http://localhost:8080/axis2/services/Axis2SampleDocLitPortType
>> and WSA Action = "" 
>>
org.apache.axis2.engine.DispatchingChecker.invoke(DispatchingChecker.java:7
>> 0) at org.apache.axis2.engine.Phase.invoke(Phase.java:167)
at 
>>
org.apache.axis2.engine.AxisEngine.invokePhases(AxisEngine.java:443)
>> at 
>>
org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:137)
>> at 
>>
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(H
>> TTPTransportUtils.java:211) at 
>>
org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:181)
>> at
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
>> at
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>> at 
>>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applicatio
>> nFilterChain.java:252) at 
>>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterC
>> hain.java:173) at 
>>
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.j
>> ava:213) at 
>>
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.j
>> ava:178) at 
>>
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:12
>> 6) at 
>>
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:10
>> 5) at 
>>
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.jav
>> a:107) at 
>>
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
>> at 
>>
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
>> at 
>>
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConn
>> ection(Http11Protocol.java:744) at 
>>
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.ja
>> va:527) at 
>>
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerW
>> orkerThread.java:80) at 
>>
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.ja
>> va:684) at java.lang.Thread.run(Thread.java:595) ; nested
>> exception is: java.lang.Exception:
org.apache.axis2.AxisFault:
>> Operation Not found EPR is
>>
http://localhost:8080/axis2/services/Axis2SampleDocLitPortType
>> and WSA Action = "" 
>>
org.apache.axis2.engine.DispatchingChecker.invoke(DispatchingChecker.java:7
>> 0) at org.apache.axis2.engine.Phase.invoke(Phase.java:167)
at 
>>
org.apache.axis2.engine.AxisEngine.invokePhases(AxisEngine.java:443)
>> at 
>>
org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:137)
>> at 
>>
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(H
>> TTPTransportUtils.java:211) at 
>>
org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:181)
>> at
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
>> 
>> 
>> I have used the sample WSDL file Axis2SampleDocLit.wsdl from
the
>> Axis2 binary distribution (version 0.93). I am running the
>> WSDL2Java using following Ant target:
>> 
>> 

>> dir="output" />  
>> classname="org.apache.axis2.wsdl.WSDL2Java" fork="true"> 
>>  
>> 
>>   
>> value="-sd"/>   
>> value="-p"/>  
>> 
>>  
>> todir="${build.classes}"> 

>> name="**/*schema*/**/*.class"/>
>> 
>> 
 
>> 
>> 
>> 
>> The code generation executes without errors and following
>> service.xml file is generated:
>> 
>>  
>> name="Axis2SampleDocLitPortType"> 
>>
name="ServiceClass">org.apache.axis2.userguide.Axis2SampleDocLitPortTypeSke
>> leton  
>>  
>>
class="org.apache.axis2.userguide.Axis2SampleDocLitPortTypeMessageReceiver"
>> />   
>> name="echoStruct"> 
>>
class="org.apache.axis2.userguide.Axis2SampleDocLitPortTypeMessageReceiver"
>> />   
>> name="echoString"> 
>>
class="org.apache.axis2.userguide.Axis2SampleDocLitPortTypeMessageReceiver"
>> />  
>> 
>> The client code looks like this:
>> 
>> 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 sa the AXIS_HOME
Axis2SampleDocLitPort

Re: [Axis2] problem with WSDL2Java generated stubs and databinding

2005-12-27 Thread iksrazal
Nikola, 

Try following this thread - worked for me when I had a similiar problem: 

http://marc.theaimsgroup.com/?l=axis-user&m=113474706726344&w=2

HTH,
iksrazal

Em Terça 27 Dezembro 2005 08:48, o Nikola Zifra escreveu:
> Hi I am getting following exception when I try to run the code generated by
> WSDL2Java tool.
>
>   - Invoking Handler 'AddressingOutHandler' in Phase 'MessageOut'
>   - Build the OMElelment EnvelopeBy the StaxSOAPModelBuilder
>   - Starting Process SOAP 1.1 message
>   - Build the OMElelment HeaderBy the StaxSOAPModelBuilder
>   - Build the OMElelment BodyBy the StaxSOAPModelBuilder
>   - Invoking Handler 'AddressingInHandler' in Phase 'PreDispatch'
>   org.apache.axis2.AxisFault: org.apache.axis2.AxisFault: Operation Not 
> found EPR is 
> http://localhost:8080/axis2/services/Axis2SampleDocLitPortType and WSA 
> Action = at
> org.apache.axis2.engine.DispatchingChecker.invoke(DispatchingChecker.java:7
>0) at org.apache.axis2.engine.Phase.invoke(Phase.java:167)
>   at
> org.apache.axis2.engine.AxisEngine.invokePhases(AxisEngine.java:443) at
> org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:137) at
> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(H
>TTPTransportUtils.java:211) at
> org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:181) at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:709) at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applicatio
>nFilterChain.java:252) at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterC
>hain.java:173) at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.j
>ava:213) at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.j
>ava:178) at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:12
>6) at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:10
>5) at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.jav
>a:107) at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
> at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
> at 
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConn
>ection(Http11Protocol.java:744) at
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.ja
>va:527) at
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerW
>orkerThread.java:80) at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.ja
>va:684) at java.lang.Thread.run(Thread.java:595)
>   ; nested exception is:
>   java.lang.Exception: org.apache.axis2.AxisFault:  Operation Not found
> EPR is  http://localhost:8080/axis2/services/Axis2SampleDocLitPortType and
> WSA  Action = at
> org.apache.axis2.engine.DispatchingChecker.invoke(DispatchingChecker.java:7
>0) at org.apache.axis2.engine.Phase.invoke(Phase.java:167)
>   at
> org.apache.axis2.engine.AxisEngine.invokePhases(AxisEngine.java:443) at
> org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:137) at
> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(H
>TTPTransportUtils.java:211) at
> org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:181) at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
>
>
>   I have used the sample WSDL file Axis2SampleDocLit.wsdl from the Axis2 
> binary distribution (version 0.93). I am running the WSDL2Java using 
> following Ant target:
>
>   
> 
> 
> 
> 
> 
>
> 
> 
> 
> 
> 
> 
> 
> 
>
> 
> 
> 
> 
>
> 
> 
> 
>
> 
>
>   The code generation executes without errors and following service.xml
> file is generated:
>
>   
>   
>name="ServiceClass">org.apache.axis2.userguide.Axis2SampleDocLitPortTypeSke
>leton 
>   
>class="org.apache.axis2.userguide.Axis2SampleDocLitPortTypeMessageReceiver"
>/> 
>   
>   
>class="org.apache.axis2.userguide.Axis2SampleDocLitPortTypeMessageReceiver"
>/> 
>   
>   
>class="org.apache.axis2.userguide.Axis2SampleDocLitPortTypeMessageReceiver"
>/> 
>   
>
>   The client code looks like this:
>
>   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 sa the AXIS_HOME Axis2SampleDocLitPortTypeStub stub=
> new  Axis2SampleDocLitPortTypeStub(null,
> "http://localhost:8080/axis2/services/Axis2SampleDocLitPortType";); //Create
> the request document to be sent.
> EchoStringParamDocument  reqDoc= 
> EchoStringParamDocument.Factory.newInstance();
> reqDoc.setEchoStringParam("Axis2