Find SOAPAction from a WSDL

一笑奈何 提交于 2019-12-10 13:49:33

问题


My requirement is to call a web service from Android and display the result in a nice manner.

But inside the web service's WSDL I don't find a SOAPAction. The WSDL looks like this:

<operation name="getStudentList">
 <soap:operation soapAction=""/>
 <input>
   <soap:body use="literal"/>
 </input>
 <output>
   <soap:body use="literal"/>
  </output>
</operation>

Is there any way to find the SOAPAction in some other places inside the WSDL? Can I call the web service and get a result without the SOAPAction?


回答1:


The SOAPAction is required for SOAP 1.1 over HTTP but it's hard to say what the behavior of your web service will be if you don't send a proper header. The web service may return a fault if it's missing the SOAPAction (or if it has an unexpected value) or it might do nothing at all.

The WSDL is the place to find the value to use for the SOAPAction, inside the <soap:operation>. If it's not specified for an operation or it's like in the example you posted (soapAction="") you normally need to add this to the request headers:

SOAPAction: ""

Try with an empty quoted string and it should work.



来源:https://stackoverflow.com/questions/14274644/find-soapaction-from-a-wsdl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!