Note that there are some explanatory texts on larger screens.

plurals
  1. POSilverlight and PHP nuSOAP communication problem
    text
    copied!<p>I am writting a silverlight application in which I want to call the php webservice written using NuSOAP. here is the WSDL of webservice</p> <pre><code> &lt;?xml version="1.0" encoding="ISO-8859-1" ?&gt; - &lt;definitions xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="urn:currencywebservice" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="urn:currencywebservice"&gt; - &lt;types&gt; - &lt;xsd:schema targetNamespace="urn:currencywebservice"&gt; &lt;xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" /&gt; &lt;xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" /&gt; &lt;/xsd:schema&gt; &lt;/types&gt; &lt;message name="GetAllCurrenciesRequest" /&gt; - &lt;message name="GetAllCurrenciesResponse"&gt; &lt;part name="return" type="xsd:string" /&gt; &lt;/message&gt; - &lt;portType name="currencywebservicePortType"&gt; - &lt;operation name="GetAllCurrencies"&gt; &lt;documentation&gt;Get all currencies available&lt;/documentation&gt; &lt;input message="tns:GetAllCurrenciesRequest" /&gt; &lt;output message="tns:GetAllCurrenciesResponse" /&gt; &lt;/operation&gt; &lt;/portType&gt; - &lt;binding name="currencywebserviceBinding" type="tns:currencywebservicePortType"&gt; &lt;soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" /&gt; - &lt;operation name="GetAllCurrencies"&gt; &lt;soap:operation soapAction="urn:currencywebservice#GetAllCurrencies" style="rpc" /&gt; - &lt;input&gt; &lt;soap:body use="literal" namespace="urn:currencywebservice" /&gt; &lt;/input&gt; - &lt;output&gt; &lt;soap:body use="literal" namespace="urn:currencywebservice" /&gt; &lt;/output&gt; &lt;/operation&gt; &lt;/binding&gt; - &lt;service name="currencywebservice"&gt; - &lt;port name="currencywebservicePort" binding="tns:currencywebserviceBinding"&gt; &lt;soap:address location="http://localhost/extras/currency/currencyservice.php" /&gt; &lt;/port&gt; &lt;/service&gt; &lt;/definitions&gt; </code></pre> <p>When I call the webservice it gives an exception</p> <pre><code>The content type text/html of response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly </code></pre> <p>The php side of service is </p> <pre><code>&lt;?php // Pull in the NuSOAP code require_once('../../lib/tools/nusoap/nusoap.php'); $ns = "urn:currencywebservice"; // Create the server instance $server = new soap_server(); // Initialize WSDL support $server-&gt;configureWSDL('currencywebservice', $ns); $server-&gt;xml_encoding = "utf-8"; $server-&gt;soap_defencoding = "utf-8"; $server-&gt;wsdl-&gt;schemaTargetNamespace = $ns; $server-&gt;register('GetAllCurrencies', array(), array('return' =&gt; 'xsd:string'), $ns, $ns."#GetAllCurrencies", 'rpc', 'literal', 'Get all currencies available'); // Define the method as a PHP function function GetAllCurrencies() { return "test return"; } // Use the request to (try to) invoke the service header('Content-Type: text/xml; charset=utf8'); $server-&gt;service($HTTP_RAW_POST_DATA); ?&gt; </code></pre> <p>Please help me out what is this problem?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload