Webservice Code Unit Not Found
huckwarren
Member Posts: 5
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
<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
0
Comments
-
I am not sure, but I thing the OnRun is not published as part of the webservice. Only defined functions are exposed...0
-
[Topic moved from 'NAV/Navision Classic Client' to 'NAV Three Tier' forum]0
-
Turns out that the company name is case sensitive and must match exactly.0
-
Today I have encountered the same error when exposed codeunit as webservice.
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.0 -
Hello, what was finally the solution? record as parameter or companyname or else?
thanks
Chris#### Only one can survive ######0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 322 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions

