gpt4 book ai didi

java - Spring WS 调用 .net Web 服务

转载 作者:行者123 更新时间:2023-12-01 16:11:54 30 4
gpt4 key购买 nike

我必须将此 Webservices 称为 .net Web 服务(嗯..我猜 WS 应该是非常独立的平台)我已在下面附加了 WSDL。

我正在使用 Spring WS 1.5.6。我不知道该在消息中添加什么内容。

我必须包含命名空间等吗?我需要指定方法名称等吗?

(第二个想法是,我使用 Axis2 是否更好?如果是,该怎么做?)

请指教提前致谢

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

最佳答案

我建议你偷懒去下载SOAP U I. 给它 WSDL,让它为您生成 XML 请求流。它将准确地向您显示请求中必须包含的内容,包括适当的命名空间。这就是我用的。

IntelliJ 有一个非常好的插件,它帮我达成了交易。如果您是 IntelliJ 用户,也请获取它。

关于java - Spring WS 调用 .net Web 服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/831562/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com