EDIT: After some research, I found the answer to the problem (at least it works for my particular situation). Instead of the register call noted down below, I am now using the following call:
$soap->register(
MyFunction ,
array( inputData => xsd:string ),
array( outputData => xsd:string ),
$namespace,
$namespace . "#MyFunction",
"rpc",
"literal",
"My description.");
I guess the "rpc" and "literal" arguments are the key to the success. Hopefully this will help some other users facing the same problem.
I have a problem with a new project, where a silverlight application is to request data from a NuSoap-service. As this integration is rather new to me and unfortunately not many resources concerning this topic can be found on the internet (none addressing my problem at least), I hope that someone can point me into the correct direction.
The NuSoap-part is implemented like this:
<?php
require_once( ../soap/nusoap/nusoap.php );
$namespace = "http://127.0.0.1/adminSoap";
$soap = new Soap_Server();
$soap->configureWSDL( MyService , $namespace);
$soap->wsdl->schemaTargetNameSpace = $namespace;
$soap->soap_defencoding = utf-8 ;
$soap->register(
MyFunction ,
array( inputData => xsd:string ),
array( outputData => xsd:string ),
$namespace
);
$soap->service(isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : );
function MyFunction($inputData)
{
return "ok";
}
?>
I then add a web reference to this service and get the dialog where I can select the service, its ServicePortType as well as "MyFunction".
If I generate the reference however, I would assume to find automatically generated asynchronous messages for MyFunction (i.e. MyFunctionAsync and the MyFunctionCompleted.event). These do not exist.
What could I be doing wrong. Here s the code that sets up the client:
ServiceReference4.MyServicePortTypeClient client = new SilverlightTest1.ServiceReference4.MyServicePortTypeClient();
Any ideas why the asynchronous method is not available?
Here s the generated WSDL, if that s of any help, btw (hyphens due to copy/paste from IE):
<definitions targetNamespace="http://127.0.0.1/adminSoap">
−
<types>
−
<xsd:schema targetNamespace="http://127.0.0.1/adminSoap">
<xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<xsd:import namespace="http://schemas.xmlsoap.org/wsdl/"/>
</xsd:schema>
</types>
−
<message name="MyFunctionRequest">
<part name="affiliate" type="xsd:string"/>
</message>
−
<message name="MyFunctionResponse">
<part name="result" type="xsd:string"/>
</message>
−
<portType name="MyServicePortType">
−
<operation name="MyFunction">
<input message="tns:MyFunctionRequest"/>
<output message="tns:MyFunctionResponse"/>
</operation>
</portType>
−
<binding name="MyServiceBinding" type="tns:MyServicePortType">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
−
<operation name="MyFunction">
<soap:operation soapAction="http://127.0.0.1/magento/adminSoap/SoapStatsService.php/MyFunction" style="rpc"/>
−
<input>
<soap:body use="encoded" namespace="http://127.0.0.1/adminSoap" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
−
<output>
<soap:body use="encoded" namespace="http://127.0.0.1/adminSoap" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
</binding>
−
<service name="MyService">
−
<port name="MyServicePort" binding="tns:MyServiceBinding">
<soap:address location="http://127.0.0.1/magento/adminSoap/SoapStatsService.php"/>
</port>
</service>
</definitions>