【发布时间】:2011-12-28 06:11:57
【问题描述】:
我有一个问题,我有一个这样的 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>
【问题讨论】:
-
仅供参考,您永远不会向 WSDL 发送请求。 WSDL 只是描述服务的 XML 文件。您正在向 WSDL 描述的服务发送请求。
-
您是否使用任何库来处理 Web 服务?
标签: java web-services soap wsdl