第一种入参及出参入参:<?xml version="1.0" encoding="UTF-8"?><service><head><security><username>wsxrmyy</username><password>123456</password><entryType>医保</entryType></security><serviceId>F00.00.00.01</serviceId><businessId>1F69D8A378C14E908694AE6A0B1CEF85</businessId ></head><request><aac161>142322197903230528</aac161><bae040>32</bae040><aae043></aae043><aac003>赵丽</aac003><aac004>2</aac004><aac002>142322197903230528</aac002><aac001></aac001><aae003></aae003><aae001></aae001><zkc005></zkc005><zkc006></zkc006><aab001></aab001><aab004></aab004><akc200></akc200><aac031></aac031><akc087>5000</akc087><akc021>3</akc021><aac120>3</aac120><zkc401></zkc401><zkc402></zkc402></request></service>
16:12:29 原始出参:<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><soap:Fault><faultcode>soap:VersionMismatch</faultcode><faultstring>No namespace on "service" element. You must send a SOAP request.</faultstring></soap:Fault></soap:Body></soap:Envelope>第二种入参及出参
入参:<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://server.webservice.smartpay.zhijieyun.com/"><soapenv:Header/><soapenv:Body><ser:execute><arg0><?xml version="1.0" encoding="UTF-8"?><service><head><security><username>wsxrmyy</username><password>123456</password><entryType>医保</entryType></security><serviceId>F00.00.00.01</serviceId><businessId>375DFE7E81AD4BAFB452E86DC3F99D07</businessId></head><request><aac161>142322197903230528</aac161><bae040>32</bae040><aae043></aae043><aac003>赵丽</aac003><aac004>2</aac004><aac002>142322197903230528</aac002><aac001></aac001><aae003></aae003><aae001></aae001><zkc005></zkc005><zkc006></zkc006><aab001></aab001><aab004></aab004><akc200></akc200><aac031></aac031><akc087>5000</akc087><akc021>3</akc021><aac120>3</aac120><zkc401></zkc401><zkc402></zkc402></request></service></arg0> </ser:execute></soapenv:Body></soapenv:Envelope>
20:21:22 原始出参:<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><soap:Fault><faultcode>soap:Client</faultcode><faultstring>Unmarshalling Error: Illegal processing instruction target ("xml"); xml (case insensitive) is reserved by the specs.&#xd;
 at [row,col {unknown-source}]: [1,192] </faultstring></soap:Fault></soap:Body></soap:Envelope>
大神们求救   。。  附有图片一张 。
悬赏求助,江湖救急,搞定给我你的微信号

解决方案 »

  1.   

    以下是我借助国内飞机航班时刻表 WEB 服务做了测试,可以通过。
    http://www.webxml.com.cn/webservices/DomesticAirline.asmx 注意要引入:SOAPHTTPTrans 和 Wininetprocedure TForm1.Button1Click(Sender: TObject);
    var
      strStream, strSend: TStringStream;
    begin
      HTTPReqResp1.URL := 'http://www.webxml.com.cn/webservices/DomesticAirline.asmx/getDomesticAirlinesTime';
      strStream := TStringStream.Create('', TEncoding.UTF8);
      strSend := TStringStream.Create('startCity=fuzhou&lastCity=beijing&theDate=2018-07-01&userID=2018-07-02', TEncoding.UTF8);
      HTTPReqResp1.Execute(strSend,strStream);
      ShowMessage(strStream.DataString);
      strStream.Free;
      strSend.Free;
    end;//设置Content-Type,可以借助抓包工具,分析你所调用的webservice的content-type应该是什么。
    procedure TForm1.HTTPReqResp1BeforePost(const HTTPReqResp: THTTPReqResp; Data: Pointer);
    const
      csCustomHeader = 'Content-Type:application/x-www-form-urlencoded;charset=UTF-8';
    begin
      HttpAddRequestHeaders(Data, PChar(csCustomHeader), Length(csCustomHeader),HTTP_ADDREQ_FLAG_REPLACE);
    end;