I'm trying to test my new webservice codeunit. When I send a message using the following code in a codeunit I get the following response. The service is listed when querying
http://localhost:2047/DynamicsNav/WS/DB Name/Services. How do I fix the problem?
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<s:Fault>
<faultcode xmlns:a="urn:microsoft-dynamics-schemas/error">a:Microsoft.Dynamics.Nav.Service.WebServices.ServiceBrokerException</faultcode>
<faultstring xml:lang="en-US">Service "CodeUnit/JDWS" was not found!</faultstring>
<detail><string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">Service "CodeUnit/JDWS" was not found!</string>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>[
xmlhttp.open('POST','http://localhost:2047/DynamicsNav/WS/Test Classic/CodeUnit/JDWS',FALSE,'','');
xmlhttp.setRequestHeader('Content-Type','text/xml');
xmlhttp.setRequestHeader('SOAPAction','JDWS');
xmlhttp.setRequestHeader('SOAPAction','urn:microsoft-dynamics-schemas/codeunit/JDWS:OnRun');
xmlhttp.send('<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://Schemas.xmlsoap.org/soap/envelope/">'+
'<soap:Body><inventoryRequest xmlns="urn:microsoft-dynamics-schemas/codeunit/JDWS">' +
'<partNumber>'+ItemNo+'</partNumber><returnCode>0</returnCode><userMessage></userMessage>'+
'<detailedMessage></detailedMessage></inventoryRequest></soap:Body></soap:Envelope>'
Name DataType Subtype Length
xmlhttp Automation 'Microsoft XML, v6.0'.ServerXMLHTTP
Comments
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Its solution is that if the codeunit contains one or more than one function having record variable as paramenter then this Exception occurs.
When I removed that record variable parameter from the function, ServiceBroker Exception did not occur.
thanks
Chris