0

I need communicate with web-service construct in .net(i think), but when i try call a method, return this error:

The SOAP action specified on the message, '', does not match the HTTP SOAP Action, 'http://tempuri.org/TripointWebservicesVersionedGeneral/Ping'.

Code to connect to web-service and execute method:

$client = new SoapClient(
                    '...?wsdl',
                        array(
                            'trace' => 1,
                            'soap_version' => SOAP_1_2
                        )
                    );

//$test = $client->__soapCall('Ping',array(''));
$test = $client->Ping();

What is the reason of this error? or what i need to do to call a method?

I have already read this PHP Fatal error: "The SOAP action specified on the message, '', does not match the HTTP SOAP Action", and put in option of soap connection this "'action' => '.../Ping'" but don't help me.

Community
  • 1
  • 1
Ricardo Martins
  • 486
  • 7
  • 19
  • In order to consume the service you need to know the structure of the function. Try to read the wsdl definition of the function you need to call. – George Violaris Jan 24 '13 at 19:10

2 Answers2

1

i've found the reason why i can't call the method's, its because of this:

One of the problems: The PHP returns "Caught exception: Cannot process the message because the content type ‘text/xml; charset=utf-8′ was not the expected type ‘application/soap+xml; charset=utf-8′."

The reason: WCF is running a new version of web services than expected by the PHP.

The solution:

Change the binding type of the WCF service from binding="wsHttpBinding" to binding="basicHttpBinding".

This insures that your .NET web service would support clients and other services that conform to the WS-I standards.

url source: http://spacebug.com/php-calling-wcf-part-1-html

Ricardo Martins
  • 486
  • 7
  • 19
0

Not a full answer, but I just wanted to highlight that you're probably facing this problem because you're using SoapClient to try and consume a web service that uses WS-Addressing. You should try to track down what others do in this situation:

http://www.cdatazone.org/index.php?/archives/15-WS-Addressing-for-extsoap.html

https://github.com/wso2/wsf

davidfmatheson
  • 3,539
  • 19
  • 27