2

I want to create a php webservice server to be used from a C# application.

I want to have a library who autogenerate wsdl file for easy management (That's the reason why I choosed NuSoap).

I tried to use nusoap on PHP5. I have some problems with charset and Content-Type.

Visual Studio gives this error :

The HTML document does not contain Web service discovery information. Metadata contains a reference that cannot be resolved: 'https://www.xxx.yy'. There is a problem with the XML that was received from the network. See inner exception for more details. The encoding in the declaration 'ISO-8859-1' does not match the encoding of the document 'utf-8'. If the service is defined in the current solution, try building the solution and adding the service reference again.

$soap= new soap_server();
$soap->xml_encoding = 'utf-8';
$soap->configureWSDL('Bonjour', 'https://www.xxx.yy');
$soap->wsdl->schemaTargetNamespace = 'http://soapinterop.org/xsd/';
$soap->register('bonjour', array('prenom' => 'xsd:string'));

$HTTP_RAW_POST_DATA = file_get_contents("php://input");

$soap->service($HTTP_RAW_POST_DATA);

header('Content-Type: application/soap+xml; charset=utf-8');

function bonjour($prenom)
{
return "Bonjour ".$prenom;
}
?>

Does someone knows how to change that to make it compliant and working ?

Thanks

1 Answer 1

1

I found finally a tutorial who worked for me like a charm : http://www.sanity-free.com/125/php_webservices_and_csharp_dotnet_soap_clients.html

Best regards !

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.