Jump to content

SOAP?


Garethp

Recommended Posts

Ok, so I have to use SOAP calls to fetch data. The format that the call has to be in is shown here

 

http://125.236.209.214/autoiaspwebservice.asmx?op=PartGroups

 

And I have no idea how to do this in PHP. I've looked into tutorials, but this is my end result

 

  <?php

$client = new SoapClient(NULL,
        array(
        "location" => "http://125.236.209.214/autoiaspwebservice.asmx",
        "uri"      => "http://autoi.com.au/PartGroups",
        "style"    => SOAP_RPC,
        "use"      => SOAP_ENCODED
           ));

print($client->__call(
        /* SOAP Method Name */
        "http://autoi.com.au/PartGroups",
        /* Parameters */
        array(
            new SoapParam(
                /* Parameter Value */
                "UserId",
                /* Parameter Name */
                xxx
        ),
		new SoapParam(
			"AuthCode",
			"xxx"
	)),
        /* Options */
        array(
            /* SOAP Method Namespace */
            "uri" => "http://autoi.com.au/PartGroups",
            /* SOAPAction HTTP Header for SOAP Method */
            "soapaction" => "http://autoi.com.au/PartGroups"
        )). "\n");
?> 

 

And this is the response

 

Fatal error: Uncaught SoapFault exception: [HTTP] Bad Request in C:\Program Files\EasyPHP 2.0b1\www\Soap.php:32 Stack trace: #0 [internal function]: SoapClient->__doRequest('<?xml version="...', 'http://125.236....', 'http://autoi.co...', 1, 0) #1 C:\Program Files\EasyPHP 2.0b1\www\Soap.php(32): SoapClient->__call('http://autoi.co...', Array, Array) #2 {main} thrown in C:\Program Files\EasyPHP 2.0b1\www\Soap.php on line 32

 

I would be so grateful if someone could tell me what I'm doing wrong, or how I can send it the way it's meant to be sent

Link to comment
https://forums.phpfreaks.com/topic/189375-soap/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.