axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Gainty" <mgai...@hotmail.com>
Subject Re: [AXIS2]XML Beans Problems
Date Mon, 05 Feb 2007 02:06:42 GMT
I really like the embedded tomcat container in netbeans but
I ran into this very situation and found that the display characteristics of variables displayed
with NetBeans are NOT what the actual values *are*

to prove this try some old fashioned System.out.println(variable) or log.debug(variable) to
view the "real" value in the log
and compare this to the value you see from the IDE which may be null (I interpret this to
be ..cant display this right now!)

The example StockQuoteServiceStub is most instructive on how to acquire the expected results
The response object would be something like get+NameOfWebApp+Response which is casted from
object returned from the returned envelope e.g.

//acquire the element from the Body of the ResponseEnvelope to a POJO
java.lang.Object object = fromOM(result.getResponseEnvelope().getBody().getFirstElement(),
                               com.ibm.w3.schemas.services._2002._11._15.stockquote.wsdl.StockQuoteServiceStub.GetStockQuoteResponse.class,
                               getEnvelopeNamespaces(result.getResponseEnvelope())

//casted to the expected result
return (com.ibm.w3.schemas.services._2002._11._15.stockquote.wsdl.StockQuoteServiceStub.GetStockQuoteResponse)object

HTH
Martin--
--------------------------------------------------------------------------- 
This e-mail message (including attachments, if any) is intended for the use of the individual
or entity to which it is addressed and may contain information that is privileged, proprietary
, confidential and exempt from disclosure. If you are not the intended recipient, you are
notified that any dissemination, distribution or copying of this communication is strictly
prohibited.
--------------------------------------------------------------------------- 
Le présent message électronique (y compris les pièces qui y sont annexées, le cas échéant)
s'adresse au destinataire indiqué et peut contenir des renseignements de caractère privé
ou confidentiel. Si vous n'êtes pas le destinataire de ce document, nous vous signalons qu'il
est strictement interdit de le diffuser, de le distribuer ou de le reproduire.
  ----- Original Message ----- 
  From: Marian Suran 
  To: axis-user 
  Sent: Sunday, February 04, 2007 4:12 PM
  Subject: [AXIS2]XML Beans Problems


  Hi,

  I am new at axis and web services and I am working on the application which requires SOAP
service usage for acquiring various data from the server. I decided to use xml beans data
binding and since service is already running I am going to implement a client. I used wsdl2java
to generate client sources and I found some bugs. First one is that I had to manually change
http "chunked" state to "false" in the service stub constructor because otherwise I got some
strange exceptions. Second bug I found is very strange. When I am at the debugger and step
over _operationClient.execute(true); method I got null pointer exception but when I watch
current value of the "env" variable of the request soap envelope in the net beans 5.5 IDE
it doesn't throw an exception and _operationClient.execute(true); works fine. I don't know
if this problem is in axis or inside net beans. Third problem is getting response return value.
Soap response envelope seems to be ok and I can see correct return values from server there
but "getReturn" from response returns null. Return value of that service is ArrayOfxxx type.
Thank you for your help. 

  Best regards,

  Marian Suran


  PS: Here is my wsdl:

  <?xml version="1.0" ?>
  <wsdl:definitions targetNamespace="urn:ibl" xmlns:apachesoap=" http://xml.apache.org/xml-soap"
xmlns:impl="urn:ibl" xmlns:intf="urn:ibl" xmlns:soapenc=" http://schemas.xmlsoap.org/soap/encoding/"
xmlns:wsdl="http://schemas.xmlsoap.org /wsdl/" xmlns:wsdlsoap=" http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd=" http://www.w3.org/2001/XMLSchema">
  <!--WSDL created by Apache Axis version: 1.4
  Built on Apr 22, 2006 (06:55:48 PDT)--> 
   <wsdl:types>
    <schema targetNamespace="urn:ibl" xmlns="http://www.w3.org/2001/XMLSchema "> 
     <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/ >
     <complexType name="Record">
      <sequence>
       <element name="icao" nillable="true" type="xsd:string"/>
       <element name="icao2" nillable="true" type="xsd:string"/> 
       <element name="iata" nillable="true" type="xsd:string"/> 
       <element name="name" nillable="true" type="xsd:string"/>
       <element name="arptid" nillable="true" type="xsd:string"/> 
       <element name="longitude" type="xsd:double"/> 
       <element name="latitude" type="xsd:double"/>
      </sequence>
     </complexType>
     <complexType name="ArrayOfRecord"> 
      <complexContent>
       <restriction base="soapenc:Array">
        <attribute ref="soapenc:arrayType" wsdl:arrayType="impl:Record[]"/>
       </restriction> 
      </complexContent>
     </complexType>
    </schema>
   </wsdl:types>
     <wsdl:message name="findByRadiusRequest">

        <wsdl:part name="in0" type="xsd:double"/>

        <wsdl:part name="in1" type="xsd:double"/>

        <wsdl:part name="in2" type="xsd:double"/>

        <wsdl:part name="in3" type="xsd:int"/>

     </wsdl:message>

     <wsdl:message name="findByIATARequest">

        <wsdl:part name="in0" type="xsd:string"/>

     </wsdl:message>

     <wsdl:message name="findByRadiusResponse1">

        <wsdl:part name="findByRadiusReturn" type="impl:ArrayOfRecord"/>

     </wsdl:message>

     <wsdl:message name="findByICAOResponse">

        <wsdl:part name="findByICAOReturn" type="impl:ArrayOfRecord"/>

     </wsdl:message>

     <wsdl:message name="findByIATAResponse">

        <wsdl:part name="findByIATAReturn" type="impl:ArrayOfRecord"/>

     </wsdl:message>

     <wsdl:message name="listAirportsRequest">

     </wsdl:message>

     <wsdl:message name="findByRadiusResponse">

        <wsdl:part name="findByRadiusReturn" type="impl:ArrayOfRecord"/>

     </wsdl:message>

     <wsdl:message name="findByRadiusRequest1">

        <wsdl:part name="in0" type="xsd:double"/>

        <wsdl:part name="in1" type="xsd:double"/>

        <wsdl:part name="in2" type="xsd:double"/>

     </wsdl:message>

     <wsdl:message name="listAirportsResponse">

        <wsdl:part name="listAirportsReturn" type="impl:ArrayOfRecord"/> 

     </wsdl:message>

     <wsdl:message name="findByICAORequest">

        <wsdl:part name="in0" type="xsd:string"/>

     </wsdl:message>

     <wsdl:portType name="Airports">

        <wsdl:operation name="findByICAO" parameterOrder="in0">

           <wsdl:input message="impl:findByICAORequest" name="findByICAORequest"/>

           <wsdl:output message="impl:findByICAOResponse" name="findByICAOResponse"/>

        </wsdl:operation>

        <wsdl:operation name="findByIATA" parameterOrder="in0">

           <wsdl:input message="impl:findByIATARequest" name="findByIATARequest"/>

           <wsdl:output message="impl:findByIATAResponse" name="findByIATAResponse"/>

        </wsdl:operation>

        <wsdl:operation name="findByRadius" parameterOrder="in0 in1 in2 in3">

           <wsdl:input message="impl:findByRadiusRequest" name="findByRadiusRequest"/>

           <wsdl:output message="impl:findByRadiusResponse" name="findByRadiusResponse"/>

        </wsdl:operation>

        <wsdl:operation name="findByRadius" parameterOrder="in0 in1 in2">

           <wsdl:input message="impl:findByRadiusRequest1" name="findByRadiusRequest1"/>

           <wsdl:output message="impl:findByRadiusResponse1" name="findByRadiusResponse1"/>

        </wsdl:operation>

        <wsdl:operation name="listAirports">

           <wsdl:input message="impl:listAirportsRequest" name="listAirportsRequest"/>

           <wsdl:output message="impl:listAirportsRespo nse" name="listAirportsResponse"/>

        </wsdl:operation>

     </wsdl:portType>

     <wsdl:binding name="airportsSoapBinding" type="impl:Airports">

        <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/
>

        <wsdl:operation name="findByICAO">

           <wsdlsoap:operation soapAction="findByICAO"/>

           <wsdl:input name="findByICAORequest">

              <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/ "
namespace="urn:ibl" use="encoded"/>

           </wsdl:input>

           <wsdl:output name="findByICAOResponse">

              <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/ "
namespace="urn:ibl" use="encoded"/>

           </wsdl:output>

        </wsdl:operation>

        <wsdl:operation name="findByIATA">

           <wsdlsoap:operation soapAction="findByIATA"/>

           <wsdl:input name="findByIATARequest">

              <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/ "
namespace="urn:ibl" use="encoded"/>

           </wsdl:input>

           <wsdl:output name="findByIATAResponse"> 

              <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/ "
namespace="urn:ibl" use="encoded"/>

           </wsdl:output>

        </wsdl:operation>

        <wsdl:operation name="findByRadius">

           <wsdlsoap:operation soapAction="findByRadius"/>

           <wsdl:input name="findByRadiusRequest">

              <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/ "
namespace="urn:ibl" use="encoded"/>

           </wsdl:input>

           <wsdl:output name="findByRadiusResponse">

              <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/ "
namespace="urn:ibl" use="encoded"/>

           </wsdl:output>

        </wsdl:operation>

        <wsdl:operation name="findByRadius">

           <wsdlsoap:operation soapAction="findByRadius1"/>

           <wsdl:input name="findByRadiusRequest1">

              <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/ "
namespace="urn:ibl" use="encoded"/>

           </wsdl:input>

           <wsdl:output name="findByRadiusResponse1">

              <wsdlsoap:body encodingStyle=" http://schemas.xmlsoap.org/soap/encoding/
" namespace="urn:ibl" use="encoded"/>

           </wsdl:output>

        </wsdl:operation>

        <wsdl:operation name="listAirports">

           <wsdlsoap:operation soapAction="listAirports"/>

           <wsdl:input name="listAirportsRequest">

              <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/ "
namespace="urn:ibl" use="encoded"/>

           </wsdl:input>

           <wsdl:output name="listAirportsResponse">

              <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/ "
namespace="urn:ibl" use="encoded"/>

           </wsdl:output>

        </wsdl:operation>

     </wsdl:binding>

     <wsdl:service name="AirportsService">

        <wsdl:port binding="impl:airportsSoapBinding" name="airports">

           <wsdlsoap:address location="http://ws.iblsoft.com/aw/airports"/>

        </wsdl:port>

     </wsdl:service>

  </wsdl:definitions>

Mime
View raw message