如何将现有 SOAP 请求发送到现有 WSDL
我有一个问题,我有一个像这样的 SOAP 请求信封:
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:str="http://string.soap.webservices.invent.telkom.co.id"><soapenv:Header/>
<soapenv:Body>
<str:PhyStatus soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<ip xsi:type="xsd:string">172.20.20.123</ip>
<slot xsi:type="xsd:string">4</slot>
<port xsi:type="xsd:string">33</port>
</str:PhyStatus>
</soapenv:Body>
</soapenv:Envelope>
我有 WSDL,它的服务具有不同的参数,但与输入的数字相同。 在java中,我如何将SOAP请求发送到这个WSDL?
供您参考,这是我想要的输出(SOAP 响应):
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://string.soap.webservices.invent.telkom.co.id" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:PhyStatusResponse>
<PhyStatusReturn xsi:type="SOAP-ENC:Struct">
<AdminStatus xsi:type="xsd:string">Active</AdminStatus>
<LinkStatus xsi:type="xsd:string">Activating</LinkStatus>
<LineProfile xsi:type="xsd:string">ADSL LINE PROFILE 10</LineProfile>
</PhyStatusReturn>
</ns1:PhyStatusResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
I have a problem, I have a SOAP request envelope like this:
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:str="http://string.soap.webservices.invent.telkom.co.id"><soapenv:Header/>
<soapenv:Body>
<str:PhyStatus soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<ip xsi:type="xsd:string">172.20.20.123</ip>
<slot xsi:type="xsd:string">4</slot>
<port xsi:type="xsd:string">33</port>
</str:PhyStatus>
</soapenv:Body>
</soapenv:Envelope>
And i have WSDL that has service with differents parameters but same numbers as the inputs.
In java, how can i send that SOAP request to this WSDL?
For your info, this is the output (SOAP response) that i want:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://string.soap.webservices.invent.telkom.co.id" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:PhyStatusResponse>
<PhyStatusReturn xsi:type="SOAP-ENC:Struct">
<AdminStatus xsi:type="xsd:string">Active</AdminStatus>
<LinkStatus xsi:type="xsd:string">Activating</LinkStatus>
<LineProfile xsi:type="xsd:string">ADSL LINE PROFILE 10</LineProfile>
</PhyStatusReturn>
</ns1:PhyStatusResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用任何 http 客户端将您的肥皂消息发布到服务,该服务的 url 为删除“?wsdl”
You can use any http client to post your soap message to the service which is the url remove "?wsdl"