Java SpringWS调用.NETWeb服务
我不得不称之为webservices,它是一个.NETWeb服务(我想,..WS应该是非常独立于平台的),我在下面附加了WSDL 我使用的是SpringWS1.5.6。我不知道该在留言里写什么 我必须包括名称空间等吗?我是否需要指定方法名等 (第二个问题是,使用Axis2是否更好?如果是,如何操作?) 请告知 提前谢谢Java SpringWS调用.NETWeb服务,java,web-services,spring,Java,Web Services,Spring,我不得不称之为webservices,它是一个.NETWeb服务(我想,..WS应该是非常独立于平台的),我在下面附加了WSDL 我使用的是SpringWS1.5.6。我不知道该在留言里写什么 我必须包括名称空间等吗?我是否需要指定方法名等 (第二个问题是,使用Axis2是否更好?如果是,如何操作?) 请告知 提前谢谢 // send to the configured default URI public void simpleSendAndReceive() { St
// 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>
//发送到配置的默认URI
public void simpleSendAndReceive(){
StreamSource source=新的StreamSource(新的StringReader(消息));
StreamResult结果=新的StreamResult(System.out);
webServiceTemplate.sendSourceAndReceiveToResult(源、结果);
}
我建议您不要太懒,下载我。给它WSDL,让它为您生成XML请求流。它将准确地显示请求中必须包含的内容,包括适当的名称空间。我就是这么用的
IntelliJ有一个非常好的插件,为我敲定了交易。如果您是IntelliJ用户,也可以这样做。我建议您懒惰一点,下载I。给它WSDL,让它为您生成XML请求流。它将准确地显示请求中必须包含的内容,包括适当的名称空间。我就是这么用的
IntelliJ有一个非常好的插件,为我敲定了交易。如果您是IntelliJ用户,也可以使用。好消息。要么您的WSDL是错误的,您可以学习如何修复它,要么您没有将SOAP UI指向正确的对象。无论哪种方式,它都是可操作的信息。Java Web Start与SOAP UI和服务有什么关系?我下载了SOAP UI,将它指向我的WSDL,它为我提供了所需的一切,特别是查看所有头并向服务发送测试的能力。好消息。要么您的WSDL是错误的,您可以学习如何修复它,要么您没有将SOAP UI指向正确的对象。无论哪种方式,它都是可操作的信息。Java Web Start与SOAP UI和服务有什么关系?我下载了SOAP UI,将它指向我的WSDL,它提供了我所需要的一切,特别是查看所有头并向服务发送测试的能力。