2009-05-06 14 views
0

Ich muss diese Webservices nennen, die ein .net Webdienste ist (naja .. WS sollte ziemlich plattformunabhängig sein, denke ich) Ich habe die WSDL unten angehängt.Spring WS ruft .net web services

Ich verwende Spring WS 1.5.6. Ich bin mir nicht sicher, was ich in die Nachricht schreiben soll.

Muss ich den Namespace usw. hinzufügen? und muss ich den Methodennamen usw. angeben?

(Zweiter Gedanke ist, bin ich besser dran Axis2 mit? Wenn ja, wie es zu tun?)

raten Bitte Vielen Dank im Voraus

// 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> 

Antwort

1

Ich würde empfehlen, dass Sie faul und laden Sie SOAP U I. Geben Sie es die WSDL und lassen Sie es den XML-Anfrage-Stream für Sie generieren. Es zeigt Ihnen genau, was in der Anfrage enthalten sein muss, einschließlich des entsprechenden Namespace. Das ist was ich benutze.

Es gibt ein sehr nettes Plug-in für IntelliJ, das den Deal für mich abschließt. Wenn Sie ein IntelliJ-Benutzer sind, sollten Sie das auch tun.

+0

Ich habe die WSDL auf das Tool hochgeladen und ich habe eine Fehlermeldung = ( –

+0

Gute Nachrichten. Entweder Ihre WSDL ist falsch, und Sie können lernen, wie es zu beheben, oder Sie zeigte SOAP UI nicht auf das Richtige. Entweder So funktioniert es: – duffymo

+0

Ich habe Java Web Start verwendet und es funktioniert nicht –