Spring ws call .net web services

I need to call this web services, which are .net web services (well .. WS should be pretty platform independent I guess) I added the WSDL below.

I am using Spring WS 1.5.6. I'm not sure what to add to the post.

Do I need to include the namespace, etc.? and do I need to specify the method name etc.?

(Second thought: am I better off using Axis2? If so, how do I do it?)

Please inform Thank you 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/">
   <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"></soap:operation>
         <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"></soap:address>
      </port>
   </service>
</definitions>

      

0


a source to share


1 answer


I would recommend that you be lazy and load SOAP U I. Give it a WSDL and let it generate an XML request stream for you. It will show you what exactly should be in the request, including the appropriate namespace. This is what I am using.



There's a very nice IntelliJ plugin out there that seals the deal for me. If you are an IntelliJ user get this as well.

+1


a source







All Articles