Jump to content

[SOLVED] call a .net service from php


tpiazza55

Recommended Posts

I am trying to make a php page call a .NET web service and return a value.

 

Running into all kinds of problems

 

I made an .NET web app that calls the web service no problem

 

 

php code below / error below that

<?php

 

require_once('lib/nusoap.php');

 

$client = new soapclient("http://localhost/phptestservice/service.asmx");

 

 

$err = $client->getError();

if ($err) {

// Display the error

echo $err ;

} else {

$answer = $client->call("hello");

 

$err = $client->getError();

if ($err) {

// Display the error

echo $err;

print_r($client->response);

 

} else {

print_r($answer);

}

}

 

 

 

?>

 

 

error message

 

soap:Client: System.Web.Services.Protocols.SoapException: Server did not recognize the value of HTTP Header SOAPAction: . at System.Web.Services.Protocols.Soap11ServerProtocolHelper.RouteRequest() at System.Web.Services.Protocols.SoapServerProtocol.RouteRequest(SoapServerMessage message) at System.Web.Services.Protocols.SoapServerProtocol.Initialize() at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)HTTP/1.1 500 Internal Server Error Server: Microsoft-IIS/5.1 Date: Thu, 19 Apr 2007 17:46:15 GMT MicrosoftOfficeWebServer: 5.0_Pub X-Powered-By: ASP.NET X-AspNet-Version: 2.0.50727 Cache-Control: private Content-Type: text/xml; charset=utf-8 Content-Length: 866 soap:ClientSystem.Web.Services.Protocols.SoapException: Server did not recognize the value of HTTP Header SOAPAction: . at System.Web.Services.Protocols.Soap11ServerProtocolHelper.RouteRequest() at System.Web.Services.Protocols.SoapServerProtocol.RouteRequest(SoapServerMessage message) at System.Web.Services.Protocols.SoapServerProtocol.Initialize() at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)

 

Link to comment
https://forums.phpfreaks.com/topic/47774-solved-call-a-net-service-from-php/
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.