简体   繁体   中英

SOAP request using PHP

I am currently building a system that requires me to make SOAP requests. I have utilised SOAP before but it was a long time ago and now I am having trouble trying to recall!

Here is the example request I have been given:

    POST /FITSPACE/MHservice.asmx HTTP/1.1
    Host: fitspace.m-cloudapps.com
    Content-Type: text/xml; charset=utf-8
    Content-Length: length
    SOAPAction: "http://m-hance.com/FITratelist"

   <?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>
               <FITratelist xmlns="http://m-hance.com/" />
           </soap:Body>
       </soap:Envelope>

This SOAP example should allow a returned list of rates for me to manipulate. Can anyone shed any light as to what URL I should be posting to for the request as that is the first obstacle I have come across. Whenver I construct the URL I thikn I should be using it brings no result back.

Thanks in advance!

You should ask for wsdl url to post this request.

Edit: I have tried below code. It seems working fine from here, giving me list of methods.

$url = 'https://XXXXXXXX.m-XXXXXX.com:XXX/FITSPACE/MHservice.asmx?WSDL';
$options["connection_timeout"] = 25;
$options["location"] = $url;
$options['trace'] = 1;

$client = new SoapClient($url,$options);
print_r($client->__getFunctions());

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM