Need a little help consuming my webservice with js. I have successfully
used the webservice through Visual Studio .NET, so I know that it is
working. I am using IBM's ws.js to try to use it with JavaScript. Here
is the appropriate code:
function getPart(name, container) {
var call = new WS.Call('/services/parts/service.php');
var nsuri = 'http://hostname.com';
var qn_op = new WS.QName('RetrievePart',nsuri);
var qn_op_resp = new WS.QName('RetrievePartResponse',nsuri);
call.invoke_rpc(
qn_op,
new Array(
{name:'part_number',value:name}
),null,
function(call,envelope) {
var ret =
envelope.get_body().get_all_children()[0].get_all_children()[0].get_value();
container.innerHTML = ret;
$('soap').innerHTML = arguments[2].escapeHTML();
}
);
}
and here is the response:
SOAP-ENV:Client
<?xml version="1.0" encoding="ISO-8859-1"?>
<SOAP-ENV:Envelope
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
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/">
<SOAP-ENV:Body><SOAP-ENV:Fault><faultcode
xsi:type="xsd:string">SOAP-ENV:Client</faultcode><faultactor
xsi:type="xsd:string"></faultactor><faultstring
xsi:type="xsd:string">Operation '' is not defined in the WSDL
for this service</faultstring><detail
xsi:type="xsd:string"></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
Which is saying that the operation ( empty string ) is not defined in
the WSDL. This leads me to believe that it is some sort of soap
encoding problem.
Anyone else had this problem?
Thanks
--
Kerry Wilson
Lead Developer
Williams Web
kwilson@... | 423.485.4747
|