Web Service receives NUll value in parameter.

svikas1
Member Posts: 25
Hi,
I am trying to consume a webservice which takes parameter, while passing parameter to the webservice via SOAP the input parameter value always passes as NULL.
Getting the Error : "Parameter inputString in method Capitalize1 in service Capitalize is null!"
Regards
Vikas Sharma
I am trying to consume a webservice which takes parameter, while passing parameter to the webservice via SOAP the input parameter value always passes as NULL.
Getting the Error : "Parameter inputString in method Capitalize1 in service Capitalize is null!"
Regards
Vikas Sharma
0
Comments
-
Can you be more specific how you are crating the soap? Are you using SOAP Toolkit? Can you give us more details???0
-
Hi,
i am using SOAP toolkit 3.0 and my code is as follows:
CREATE(locautSoapHttpConnector);
locautSoapHttpConnector.Property('EndPointURL', 'http://localhost:7047/DynamicsNav/ws/CRONUS_Retail_India_Ltd/Codeunit/Capitalize');
locautSoapHttpConnector.Connect;
locautSoapHttpConnector.Property('SoapAction','urn:microsoft-dynamics-schemas/codeunit/Capitalize');
locautSoapHttpConnector.BeginMessage;
CREATE(locautSoapSerializer);
locautSoapSerializer.Init(locautSoapHttpConnector.InputStream);
locautSoapSerializer.startEnvelope('SOAP','STANDARD');
//tempvar := 'helloworld';
locautSoapSerializer.startBody('STANDARD');
locautSoapSerializer.startElement('Capitalize1');
locautSoapSerializer.startElement('InputString');
locautSoapSerializer.writeString('45');
locautSoapSerializer.endElement;
locautSoapSerializer.endElement;
locautSoapSerializer.endBody;
locautSoapSerializer.endEnvelope;
locautSoapHttpConnector.EndMessage;
CREATE(locautXmlDoc);
locautXmlDoc.load(locautSoapHttpConnector.OutputStream);
locautXmlDoc.save('c:\temp2.xml');
The web service is Capitalize and it has function Capitalize1 which take integer as a parameter.
Thanks & Regards
Vikas0 -
Try this (commnts in code):
CREATE(locautSoapHttpConnector); locautSoapHttpConnector.Property('EndPointURL', 'http://localhost:7047/DynamicsNav/ws/CRONUS_Retail_India_Ltd/Codeunit/Capitalize'); //<-This is path to the WSDL of the WS? locautSoapHttpConnector.Connect; locautSoapHttpConnector.Property('SoapAction','urn:microsoft-dynamics-schemas/codeunit/Capitalize1'); //<-Name of the called function locautSoapHttpConnector.BeginMessage; CREATE(locautSoapSerializer); locautSoapSerializer.Init(locautSoapHttpConnector.InputStream); locautSoapSerializer.startEnvelope('SOAP','STANDARD'); //I am using this, but without parameters //tempvar := 'helloworld'; locautSoapSerializer.startBody('STANDARD'); locautSoapSerializer.startElement('Capitalize1'); //I am using this, but with second parameter- WS namespace locautSoapSerializer.startElement('InputString'); locautSoapSerializer.writeString('45'); locautSoapSerializer.endElement; locautSoapSerializer.endElement; locautSoapSerializer.endBody; locautSoapSerializer.endEnvelope; locautSoapHttpConnector.EndMessage; CREATE(locautXmlDoc); locautXmlDoc.load(locautSoapHttpConnector.OutputStream); locautXmlDoc.save('c:\temp2.xml');
0 -
Hi,
I tried with the modification you send but the error remains the same.
Thanks & Regards
Vikas Sharma0 -
I don't know too much about the SOAP toolkit - could you dump the SOAP string you are sending together with the function in your codeunit (just the header)
I did notice in your errormessage inputString was written with lower case i and in your SOAP above it is written with Capital I - I do think that they are case sensitive.Freddy Kristiansen
Group Program Manager, Client
Microsoft Dynamics NAV
http://blogs.msdn.com/freddyk
The information in this post is provided "AS IS" with no warranties, and confers no rights. This post does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.0 -
Its working now. The reason was case sensitive.
Thanx Freddy and Kamil.
Regards
Vikas0 -
Hi,
I have the same problem with my web service published in Dynamics. I'm trying to access to method "CreateOrder" with parameter "parVendor". But i have always the same error:
Parameter parVendor in method CreateOrder in service CreateDocuments is null!
I don't idea of what is the problem with my code. I hav e try to call another simple method like HelloWorld and i didn't have any problem.
My code:
CREATE(locautSoapHttpConnector);
locautSoapHttpConnector.Property('EndPointURL',
'http://localhost:7047/DynamicsNAV/WS/[MyCompany]/Codeunit/CreateDocuments');
l
ocautSoapHttpConnector.Connect;
locautSoapHttpConnector.Property('Timeout', 5 * 1000);
locautSoapHttpConnector.Property('SoapAction',
'urn:microsoft-dynamics-schemas/Codeunit/CrearDocumentos/CreateOrder');
locautSoapHttpConnector.BeginMessage;
CREATE(locautSoapSerializer);
locautSoapSerializer.Init(locautSoapHttpConnector.InputStream);
locautSoapSerializer.startEnvelope('SOAP','STANDARD');
locautSoapSerializer.startBody;
locautSoapSerializer.startElement('CreateOrder');
locautSoapSerializer.startElement('parVendor');
locautSoapSerializer.writeString('Vend001'); //Any text
locautSoapSerializer.endElement;
locautSoapSerializer.endElement;
locautSoapSerializer.endBody;
locautSoapSerializer.endEnvelope;
locautSoapHttpConnector.EndMessage;
CREATE(locautXmlDoc);
locautXmlDoc.load(locautSoapHttpConnector.OutputStream);
locautXmlDoc.save('c:\temp1.xml'); //Here i save the result and is where i have the error i've said
Can somebody help me with that.
Thanks. ](*,)0 -
I'm trying to connect to connect from one Nav2009SP1 instance "A" to another Nav20009SP1 instance "B". I don't know if this will show you more clearly what I want to do.0
-
I also had a Webservice that gave a parameter NULL error, while the parameter (In our case a User ID) was certainly not NULL.
At the customers site, the WebService servicetier was installed after and separated from the RTC Servicetier with another name.
And believe it or not, but our solution to get rid of the NULL error was to remove both servicetiers and create them again, in one Service- subdirectory and, most important, with 1 instance name!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
- 320 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