Jump to content

Recommended Posts

I keep getting this error from the SOAP server: Server did not recognize the value of HTTP Header SOAPAction: [a href=\"http://authorize.net/merchantApi/#GetReturns\" target=\"_blank\"]http://authorize.net/merchantApi/#GetReturns[/a]. Which I thought made sense. I know that it is wanting "http://authorize.net/merchantApi/GetReturns". Not sure how or why that pound gets put there, but then I tried to make the same script in Perl with SOAP::Lite and it puts it there too, so I get the exact same error. Think the last time I used SOAP was 2 years ago, so maybe I'm just too rusty. Here is the XML I am needing to produce:

[a href=\"https://account.authorize.net/api/merchantapi.asmx?op=GetReturns\" target=\"_blank\"]https://account.authorize.net/api/merchanta...x?op=GetReturns[/a]

It's a really small call. And here is my current PHP:

[code]
class auth {
    private $login;
    private $password;
    
    public function __construct($login,$password) {
        $this->login = $login;
        $this->password = $password;
    }
}

$client = new SoapClient(null,
    array(
        'location' => 'https://account.authorize.net/api/merchantapi.asmx',
        'uri' => 'http://authorize.net/merchantApi/'
    )
);

// Tried this way of connecting too.
// $client = new SoapClient('https://account.authorize.net/api/merchantapi.asmx?WSDL');

$auth = new auth('login','password');

$header = new SoapHeader('http://authorize.net/merchantApi/','InHeader', $auth);

$result = $client->__soapCall('GetReturns', array('transactionID' => 123456789), null, $header);

if (is_soap_fault($result)) {
   trigger_error("SOAP Fault: (faultcode: {$result->faultcode}, faultstring: {$result->faultstring})", E_ERROR);
}
[/code]
Link to comment
https://forums.phpfreaks.com/topic/10881-soap-problems/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.