Options

SOAP parameters passed to Nav 2013 R2 are treated as null

DouglasDouglas Member Posts: 10
edited 2015-09-22 in NAV Three Tier
I`m trying to call a Nav 2013 R2 web service codeunit with a custom SOAP command and I get a response indicating that the parameters being passed are null, which they are not. ](*,)

Does anyone have an answer as to why this is happening or could point me in a direction that could help solve this.

Here is the SOAP request:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><TransferOrderCreate xmlns="urn:microsoft-dynamics-schemas/Codeunit/WebTestCodeunit"><ptext>this is some text</ptext><pint>999</pint></TransferOrderCreate></soap:Body></soap:Envelope>

Here is the SOAP response:
<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.WebMetadata.ServiceBrokerException</faultcode><faultstring xml:lang="en-CA">Parameter ptext in method TransferOrderCreate in service WebTestCodeunit is null! </faultstring><detail><string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">Parameter ptext in method TransferOrderCreate in service WebTestCodeunit is null! </string></detail></s:Fault></s:Body></s:Envelope>

Here is the service as exposed by Nav:
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="urn:microsoft-dynamics-schemas/codeunit/WebTestCodeunit" targetNamespace="urn:microsoft-dynamics-schemas/codeunit/WebTestCodeunit" debug="true">
<script id="FirebugLite" firebugIgnore="true" extension="Chrome"/>
<types>
<schema xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="urn:microsoft-dynamics-schemas/codeunit/WebTestCodeunit">
<element name="TransferOrderCreate">
<complexType>
<sequence>
<element minOccurs="1" maxOccurs="1" name="ptext" type="string"/>
<element minOccurs="1" maxOccurs="1" name="pint" type="int"/>
</sequence>
</complexType>
</element>
<element name="TransferOrderCreate_Result">
<complexType>
<sequence>
<element minOccurs="1" maxOccurs="1" name="return_value" type="string"/>
</sequence>
</complexType>
</element>
</schema>
</types>
<message name="TransferOrderCreate">
<part name="parameters" element="tns:TransferOrderCreate"/>
</message>
<message name="TransferOrderCreate_Result">
<part name="parameters" element="tns:TransferOrderCreate_Result"/>
</message>
<portType name="WebTestCodeunit_Port">
<operation name="TransferOrderCreate">
<input name="TransferOrderCreate" message="tns:TransferOrderCreate"/>
<output name="TransferOrderCreate_Result" message="tns:TransferOrderCreate_Result"/>
</operation>
</portType>
<binding name="WebTestCodeunit_Binding" type="tns:WebTestCodeunit_Port">
<binding xmlns="http://schemas.xmlsoap.org/wsdl/soap/" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="TransferOrderCreate">
<operation xmlns="http://schemas.xmlsoap.org/wsdl/soap/" soapAction="urn:microsoft-dynamics-schemas/codeunit/WebTestCodeunit:TransferOrderCreate" style="document"/>
<input name="TransferOrderCreate">
<body xmlns="http://schemas.xmlsoap.org/wsdl/soap/" use="literal"/>
</input>
<output name="TransferOrderCreate_Result">
<body xmlns="http://schemas.xmlsoap.org/wsdl/soap/" use="literal"/>
</output>
</operation>
</binding>
<service name="WebTestCodeunit">
<port name="WebTestCodeunit_Port" binding="tns:WebTestCodeunit_Binding">
<address xmlns="http://schemas.xmlsoap.org/wsdl/soap/" location="http://lt0619.xx.xxxxxxxx.xx:11047/Trunk/WS/7002/Codeunit/WebTestCodeunit"/>
</port>
</service>
</definitions>

Comments

  • Options
    TonyDuarteTonyDuarte Member Posts: 92
    Hi Douglas,

    See this code I'm using to call a Nav Web Service, I'm thinking you need the other definitions you are missing.
    Check the aditional properties i'm using and see if with them added to your envelope it will make the communication to work.
    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <soap:Body>
        <Read xmlns="urn:microsoft-dynamics-schemas/page/crmcustomerlist">
          <No>C01700</No>
        </Read>
      </soap:Body>
    </soap:Envelope>
    
Sign In or Register to comment.