keyboardcowboy Posted June 11, 2012 Share Posted June 11, 2012 Hey fellas! i've tried everything! I'm using this WSDL : http://test.psdataservices.com/PSShipCarrierAPI/PSShipCarrier.svc?WSDL and am simply just trying to authenticate. I keep getting this error: The SOAP action specified on the message, '', does not match the HTTP SOAP Action, 'http://tempuri.org/IPSShipCarrier/Authenticate' Here is my code: $options = array( "soap_version" => SOAP_1_2, "trace"=>1, 'UserName'=>'blahremoved', 'Password'=>'blahremoved', 'AuthToken'=>'blahremoved', 'SOAPAction'=>'http://tempuri.org/IPSShipCarrier/Authenticate', 'Action'=>'http://tempuri.org/IPSShipCarrier/Authenticate', 'uri'=>'http://tempuri.org/IPSShipCarrier/Authenticate', 'exceptions'=>true ); $client = new SoapClient( "http://test.psdataservices.com/PSShipCarrierAPI/PSShipCarrier.svc?WSDL", $options ); $auth = array( 'UserName'=>'blahremoved', 'Password'=>'blahremoved', 'AuthToken'=>'blahremoved', 'SOAPAction'=>'http://tempuri.org/IPSShipCarrier/Authenticate', 'Action'=>"Authenticate" ); $header = new SoapHeader('http://tempuri.org/IPSShipCarrier/Authenticate','Authenticate',$auth,false); $client->__setSoapHeaders($header); $params = new StdClass; $params->Action = "http://tempuri.org/IPSShipCarrier/Authenticate"; $params->SOAPAction = "http://tempuri.org/IPSShipCarrier/Authenticate"; $params->UserName = "blahremoved"; $params->Password = "blahremoved"; $params->AuthToken = "blahremoved"; $client->Authenticate($params); Thanks in advance! Much appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/264009-soap-error-the-soap-action-specified-on-the-message-does-not-match-the/ Share on other sites More sharing options...
btherl Posted June 12, 2012 Share Posted June 12, 2012 That looks like a bit of a mess. You've provided the action and other variables in 3 different places. The first step for soap debugging is to start out by seeing what the soap library is really sending. For that you can use these: http://www.php.net/manual/en/soapclient.getlastrequest.php http://www.php.net/manual/en/soapclient.getlastrequestheaders.php Also you can remove your authentication info from $options, SoapClient is not interested in them. The soap client options are listed here: http://www.php.net/manual/en/soapclient.soapclient.php These should either be in the headers or passed to the client in $params, depending on what is expected. Even then you can have other problems if the server is not written to expect php's soap library as a client.. and that's where you need to see the actual message to debug it. Quote Link to comment https://forums.phpfreaks.com/topic/264009-soap-error-the-soap-action-specified-on-the-message-does-not-match-the/#findComment-1353081 Share on other sites More sharing options...
keyboardcowboy Posted June 12, 2012 Author Share Posted June 12, 2012 Thanks for your response. I passed them 3 times just to make sure ... It doesn't mess the response up by doing so. Wanted to make sure I had all my bases covered. I just need to know how to pass that action variable to the http ... Thoughts ? Quote Link to comment https://forums.phpfreaks.com/topic/264009-soap-error-the-soap-action-specified-on-the-message-does-not-match-the/#findComment-1353084 Share on other sites More sharing options...
btherl Posted June 12, 2012 Share Posted June 12, 2012 If that's a microsoft soap server I would be looking at the MSDN soap documentation. AFAIK their soap servers expect the action in the headers. Which you appear to be doing.. maybe try SoapAction instead of SOAPAction? Quote Link to comment https://forums.phpfreaks.com/topic/264009-soap-error-the-soap-action-specified-on-the-message-does-not-match-the/#findComment-1353085 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.