发送soap型webservice消息

 

POST /webservice/Service.asmx HTTP/1.1
Host: 132.159.206.26
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/WebserviceTest"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <WebserviceTest xmlns="http://tempuri.org/">
      <str>string</str>
    </WebserviceTest>
  </soap:Body>
</soap:Envelope>
 

发送soap消息时,如果碰到bad request或internal server error等,可以判断可能是自定义参数部分不符合接口要求,比如参数内容中如string含有<或>应用&lt;或&gt;替代

 

str0= REPLACE( str0, "<", "&lt;" )
str0= REPLACE( str0, ">", "&gt;" )

你可能感兴趣的:(xml,webservice,SOAP)