views:

378

answers:

1

Hi Gurus,

I have to call this webservices which is a .net web services (well.. WS should be pretty platform independent I guess) I have attached the WSDL below.

I am using Spring WS 1.5.6. I am not sure what to put in the message.

Do I have to include the namespace etc? and Do I need to specify the method name etc?

(Second thought is, am I better off using Axis2? if so, how to do it?)

Please advise Thanks in advance

// send to the configured default URI
    public void simpleSendAndReceive() {
        StreamSource source = new StreamSource(new StringReader(MESSAGE));
        StreamResult result = new StreamResult(System.out);
        webServiceTemplate.sendSourceAndReceiveToResult(source, result);
    }




   <?xml version="1.0" encoding="UTF-8"?>
<?Siebel-Property-Set EscapeNames="false"?>
<definitions
 xmlns="http://schemas.xmlsoap.org/wsdl/"
 xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
 targetNamespace="http://extsup01/asi/"
 xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
 xmlns:tns="http://extsup01/asi/"&gt;
   <types></types>
   <message
 name="aPLServiceAttachmentWSsGetAttach_Input">
      <partname="sInput" type="xsd:string"></part>
   </message>
   <message name="aPLServiceAttachmentWSsGetAttach_Output">
      <part name="sOutput" type="xsd:string"></part>
   </message>
   <portType name="aPL_spcService_spcAttachment_spcWS">
      <operation name="aPLServiceAttachmentWSsGetAttach">
         <input message="tns:aPLServiceAttachmentWSsGetAttach_Input"></input>
         <output message="tns:aPLServiceAttachmentWSsGetAttach_Output"></output>
      </operation>
   </portType>
   <binding name="aPL_spcService_spcAttachment_spcWS" type="tns:aPL_spcService_spcAttachment_spcWS">
      <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"></soap:binding>
      <operation name="aPLServiceAttachmentWSsGetAttach">
         <soap:operation soapAction="rpc/http://extsup01/asi/:aPLServiceAttachmentWSsGetAttach"&gt;&lt;/soap:operation&gt;
         <input>
            <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://extsup01/asi/" use="encoded"></soap:body>
         </input>
         <output>
            <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://extsup01/asi/" use="encoded"></soap:body>
         </output>
      </operation>
   </binding>
   <service name="aPL_spcService_spcAttachment_spcWS">
      <port binding="tns:aPL_spcService_spcAttachment_spcWS" name="aPL_spcService_spcAttachment_spcWS">
         <soap:address location="http://extsup01/some_url"&gt;&lt;/soap:address&gt;
      </port>
   </service>
</definitions>
+1  A: 

I'd recommend that you be lazy and download SOAP UI. Give it the WSDL and let it generate the XML request stream for you. It'll show you exactly what has to be in the request, including the appropriate namespace. That's what I use.

There's a very nice plug-in for IntelliJ that seals the deal for me. If you're an IntelliJ user, get that as well.

duffymo
I uploaded the wsdl to the tool and I got an error =(
Roy Chan
Good news. Either your WSDL is wrong, and you can learn how to fix it, or you didn't point SOAP UI to the right thing. Either way it's actionable information.
duffymo
I have used the Java Web Start and it doesn't work
Roy Chan
What does Java Web Start have to do with SOAP UI and services?
duffymo
I downloaded SOAP UI, pointed it at my WSDL and it gave me everything I needed, especially the ability to see all the headers and make test sends to the service.
rado