由于其他人使用Apache Axis版本1.4创建了格式错误的WSDL定义,因此我很难创建WSDL客户端。
让我告诉您我正在执行的步骤:
首先,我在SOAP IU上加载我的WSDL端点http://xxxxx/uglySoap?wsdl。该程序自动生成以下请求:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:bal="http://xxxx/uglySoap.xsd">
<soapenv:Header/>
<soapenv:Body>
<bal:CreditRequest>
<bal:MSISDN>?</bal:MSISDN>
<bal:amountToCredit>?</bal:amountToCredit>
<!--Optional:-->
<bal:reason>?</bal:reason>
<bal:transId>?</bal:transId>
</bal:CreditRequest>
</soapenv:Body>
</soapenv:Envelope>
此请求是错误的,因为它缺少标题(您在其中提供凭据)。在SOAP UI上,这不是问题,我可以手动添加缺少的文本,并且可以完美运行。
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:msp="http:xxxxxx/uglySoap.xsd" xmlns:bal="http://xxxxxx/uglySoap.xsd">
<soapenv:Header>
<msp:messageHeader>
<msp:trackingMessageHeader>
<msp:messageId>xxx</msp:messageId>
<msp:carrierId>xxx</msp:carrierId>
<msp:userId>xxxx</msp:userId>
<msp:password>xxxx</msp:password>
</msp:trackingMessageHeader>
</msp:messageHeader>
</soapenv:Header>
<!--from here is the same thing as before-->
<soapenv:Body>
<bal:CreditRequest>
<bal:MSISDN>xxxxx</bal:MSISDN>
<bal:amountToCredit>xxxx</bal:amountToCredit>
<!--Optional:-->
<bal:reason>xxxx</bal:reason>
<bal:transId>xxxx</bal:transId>
</bal:CreditRequest>
</soapenv:Body>
</soapenv:Envelope>
当我尝试在Java上使用Web服务时,真正的痛苦开始了。 Eclipse CXF 2.7.9。该工具将毫无问题地导入已安装bot的wsdl版本,但是调用它们的方法是没有用的,因为它们很不错。
creditResponse = balanceManager.getBalanceManagement()。applyCredit(creditRequest,authHeader);
JAVA错误:未为类型BalanceManagement定义方法credit(CreditRequest,MessageHeader)。真的吗您已经知道这将要发生。
所以...
[请问,对于Java,有什么解决方案可以像SOAP UI一样打孔我的SOAP请求,URL,并以.XML文件(甚至是纯文本格式,没有问题!)获得响应?
谢谢!
由于其他人使用Apache Axis版本1.4创建了格式错误的WSDL定义,因此我很难创建WSDL客户端。让我向您展示我要执行的步骤:首先,我...
[伙计们,我找到了一个可行的解决方案来手动提出请求。