Hi,

I am evaluating of we can use xFire to invoke third party webservices. I
have generated client side stubs using WsGen tool. But when I invoke the
service, the response elements are always unpopulated (Response object
itself however is not null). I've checked using tcpmon that the service is
returning correct data. I've spent a  lot of time trying to debug this, but
could not.  Am I missing something?

Thank you in advance.

Here is my client code:
   public test1(){
       HelloServiceClient client = new HelloServiceClient();
       HelloServiceSOAP helloService = client.getHelloService();

       HelloRequest outr = new HelloRequest();
       HelloRequest.Request request = new HelloRequest.Request();
       request.setName("jdjsd");
       outr.setRequest(request);

       HelloResponse response = helloService.hello(outr);

       log.info(response);
   }


The response I see on tcpMon is like this:
<?xml version="1.0"?>
  <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>
     <soap:Body>
        <helloResponse xmlns="http://HelloWorld.com/2007-01-01";>
           <Response>
              <aGreeting>abrakadabra</aGreeting>
           </Response>
        </helloResponse>
     </soap:Body>
  </soap:Envelope>



This is the WSDL:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
   xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; xmlns:xsd="
http://www.w3.org/2001/XMLSchema";
   xmlns:tns="http://HelloWorld.com/2007-01-01"; targetNamespace="
http://HelloWorld.com/2007-01-01";>
   <wsdl:types>
       <xsd:schema xmlns:ns0="http://HelloWorld.com/2007-01-01";
           targetNamespace="http://HelloWorld.com/2007-01-01";>
               <xsd:element name="helloRequest">
               <xsd:complexType>
                   <xsd:sequence>
                          <xsd:element name="Request">
                           <xsd:complexType>
                               <xsd:sequence>
                                   <xsd:element name="name"
type="xsd:string" />
                               </xsd:sequence>
                           </xsd:complexType>
                       </xsd:element>
                   </xsd:sequence>
               </xsd:complexType>
           </xsd:element>
           <xsd:element name="helloResponse">
               <xsd:complexType>
                   <xsd:sequence>
                       <xsd:element name="Response" type="tns:Greeting" />
                   </xsd:sequence>
               </xsd:complexType>
           </xsd:element>
           <xsd:complexType name="Greeting">
               <xsd:sequence>
                   <xsd:element name="aGreeting" type="xsd:string" />
               </xsd:sequence>
           </xsd:complexType>
       </xsd:schema>
   </wsdl:types>
   <wsdl:message name="helloRequest">
       <wsdl:part name="body" element="tns:helloRequest" />
   </wsdl:message>
   <wsdl:message name="helloResponse">
       <wsdl:part name="body" element="tns:helloResponse" />
   </wsdl:message>

   <wsdl:portType name="HelloServiceSOAP">
       <wsdl:operation name="hello">
           <wsdl:input message="tns:helloRequest" />
           <wsdl:output message="tns:helloResponse" />
       </wsdl:operation>
   </wsdl:portType>
   <wsdl:binding name="HelloServiceSOAP" type="tns:HelloServiceSOAP">
       <soap:binding style="document" transport="
http://schemas.xmlsoap.org/soap/http"; />
       <wsdl:operation name="hello">
           <soap:operation soapAction="doesnt_matter" />
           <wsdl:input>
               <soap:body use="literal" />
           </wsdl:input>
           <wsdl:output>
               <soap:body use="literal" />
           </wsdl:output>
       </wsdl:operation>
   </wsdl:binding>
   <wsdl:service name="HelloService">
       <wsdl:port name="HelloService" binding="tns:HelloServiceSOAP">
           <soap:address
               location="
http://somehost/1/2/3/4/5/6/7/8/9/10/11/12/13/14/15/"; />
       </wsdl:port>
   </wsdl:service>
</wsdl:definitions>


Thanks,
Delta

Reply via email to