首页 文章

SOAP响应/请求然后如何将其转换为PHP

提问于
浏览
1

任何人都可以指导我在PHP中编码的方式吗?

Request

<?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:Header> <UserCredentials xmlns =”http:// LMWService /“ > <userName> string </ userName> <password> string </ password> </ UserCredentials> </ soap:Header> <soap:Body> <LocSingleLocation xmlns =“http:// LMWService /”> <Msisdn> string < / Msisdn> </ LocSingleLocation> </ soap:Body> </ soap:Envelope>

Response

<?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> <GetLocationSingleResult xmlns =”http:// LMWService /“ > <Msisdn> string </ Msisdn> <Lat> string </ Lat> <Lon> string </ Lon> <Datetime> string </ Datetime> <Errcode> string </ Errcode> <Errdesc> string </ Errdesc> < / GetLocationSingleResult> </ soap:Body> </ soap:Envelope>

我如何能够获得有关上述请求/响应的POST,主机,内容类型,内容长度,SOAPAction?

1 回答

  • 0

    如果您使用的是PHP的内置SOAP客户端,则可以使用以下命令获取所有http标头,例如Content-Type,Content-Length,SOAPAction等 .

    var_dump($soapclient->__getLastRequestHeaders());
    

    var_dump($soapclient->__getLastResponseHeaders());
    

相关问题