CRUD(create,Update,Read and delete) in Web Service Navision!

HanenHanen Member Posts: 281
edited 2013-09-30 in NAV Three Tier
Hi,

I'm using navision customer webservice and calling the Create, Read, Update, Delete methods in a C# project (WCF Technology), I have a little problem calling the update and the delete methods :oops:
How can I update the appropriate customer record? What's the right instruction to use to update and to delete a customer record?

Thanks for your Help. :thumbsup:
Regards

Hanen TALBI

Comments

  • Ashish_GuptaAshish_Gupta Member Posts: 56
    hi,

    First you have read the record which you want to delete by using read and then pass the whole key values to the delete command.
    Service x = new Service();
                a y = new a();
                y.Code = Txt1.Text;
                y = x.Read(y.Code);
                x.Update(ref y);
               
    
    delete is same as update in this first you have to read the record and then delete it by using key
     x.Delete(y.Key);
    
    
    Ashish Gupta
    Navision Technical Consultant
  • HanenHanen Member Posts: 281
    Thaaaaaaaanks =D> :thumbsup:
    Regards

    Hanen TALBI
  • marco.morrealemarco.morreale Member Posts: 58
    Hanen wrote:
    Hi,

    I'm using navision customer webservice and calling the Create, Read, Update, Delete methods in a C# project (WCF Technology), I have a little problem calling the update and the delete methods :oops:
    How can I update the appropriate customer record? What's the right instruction to use to update and to delete a customer record?

    Thanks for your Help. :thumbsup:

    Hello Hanen,
    I am trying to do the same thing but I am having some problems with NAV2009 implementation of WCF. Many people suggest using "Web reference" feature (for compatibility wiht Framework 2.0)but I think WCF would be a better chioce.

    My first problem is that when I add my web service as a Service Reference, I cannot find the service class with all the read, readmultiple, update method.
    I found classes whit those name but I couldn't make them work for retrieving data.

    Please can you give me a hint?
    Thanks in advance
    Marco
  • HanenHanen Member Posts: 281
    Hi,

    Did you try to expose the wsdl schema?????? When you use the url what did you get? The xml components?
    If the object (page or code unit) is not published properly you will not get the diffrent functions related to the web service update, create.... So can you give me more details
    Regards

    Hanen TALBI
  • marco.morrealemarco.morreale Member Posts: 58
    I think the wsdl schema is ok beacause using the "web reference" mode everything work fine. My problems start when I switch to "service reference" (WCF).

    Here is my schema (sorry for the verbose post):

    definitions targetNamespace="urn:microsoft-dynamics-schemas/page/rdcwebcustomer" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="urn:microsoft-dynamics-schemas/page/rdcwebcustomer">
    - <types>
    - <xsd:schema elementFormDefault="qualified" targetNamespace="urn:microsoft-dynamics-schemas/page/rdcwebcustomer" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
    - <xsd:simpleType name="Blocked">
    - <xsd:restriction base="xsd:string">
    <xsd:enumeration value="_blank_" />
    <xsd:enumeration value="Ship" />
    <xsd:enumeration value="Invoice" />
    <xsd:enumeration value="All" />
    </xsd:restriction>
    </xsd:simpleType>
    - <xsd:complexType name="RDCWebCustomer">
    - <xsd:sequence>
    <xsd:element minOccurs="0" maxOccurs="1" name="Key" type="xsd:string" />
    <xsd:element minOccurs="0" maxOccurs="1" name="No" type="xsd:string" />
    <xsd:element minOccurs="0" maxOccurs="1" name="Name" type="xsd:string" />
    <xsd:element minOccurs="0" maxOccurs="1" name="Address" type="xsd:string" />
    <xsd:element minOccurs="0" maxOccurs="1" name="City" type="xsd:string" />
    <xsd:element minOccurs="0" maxOccurs="1" name="Post_Code" type="xsd:string" />
    <xsd:element minOccurs="0" maxOccurs="1" name="County" type="xsd:string" />
    <xsd:element minOccurs="0" maxOccurs="1" name="Salesperson_Code" type="xsd:string" />
    <xsd:element minOccurs="0" maxOccurs="1" name="Blocked" type="tns:Blocked" />
    <xsd:element minOccurs="0" maxOccurs="1" name="Salesperson_Name" type="xsd:string" />
    <xsd:element minOccurs="0" maxOccurs="1" name="Bill_to_Customer_No" type="xsd:string" />
    <xsd:element minOccurs="0" maxOccurs="1" name="Bill_To_Name" type="xsd:string" />
    <xsd:element minOccurs="0" maxOccurs="1" name="Bill_To_Address" type="xsd:string" />
    <xsd:element minOccurs="0" maxOccurs="1" name="Bill_To_City" type="xsd:string" />
    <xsd:element minOccurs="0" maxOccurs="1" name="Bill_To_Post_Code" type="xsd:string" />
    <xsd:element minOccurs="0" maxOccurs="1" name="Bill_To_County" type="xsd:string" />
    <xsd:element minOccurs="0" maxOccurs="1" name="Customer_Disc_Group" type="xsd:string" />
    <xsd:element minOccurs="0" maxOccurs="1" name="Customer_Price_Group" type="xsd:string" />
    <xsd:element minOccurs="0" maxOccurs="1" name="Payment_Method_Code" type="xsd:string" />
    <xsd:element minOccurs="0" maxOccurs="1" name="Payment_Method_Desc" type="xsd:string" />
    <xsd:element minOccurs="0" maxOccurs="1" name="Payment_Terms_Code" type="xsd:string" />
    <xsd:element minOccurs="0" maxOccurs="1" name="Payment_Terms_Desc" type="xsd:string" />
    <xsd:element minOccurs="0" maxOccurs="1" name="VAT_Registration_No" type="xsd:string" />
    <xsd:element minOccurs="0" maxOccurs="1" name="Fiscal_Code" type="xsd:string" />
    <xsd:element minOccurs="0" maxOccurs="1" name="Phone_No" type="xsd:string" />
    <xsd:element minOccurs="0" maxOccurs="1" name="Fax_No" type="xsd:string" />
    <xsd:element minOccurs="0" maxOccurs="1" name="E_Mail" type="xsd:string" />
    <xsd:element minOccurs="0" maxOccurs="1" name="Home_Page" type="xsd:string" />
    <xsd:element minOccurs="0" maxOccurs="1" name="Balance_LCY" type="xsd:decimal" />
    <xsd:element minOccurs="0" maxOccurs="1" name="Exposure_LCY" type="xsd:decimal" />
    <xsd:element minOccurs="0" maxOccurs="1" name="Issues_Find" type="xsd:string" />
    </xsd:sequence>
    </xsd:complexType>
    - <xsd:complexType name="RDCWebCustomer_List">
    - <xsd:sequence>
    <xsd:element minOccurs="1" maxOccurs="unbounded" name="RDCWebCustomer" type="tns:RDCWebCustomer" />
    </xsd:sequence>
    </xsd:complexType>
    - <xsd:simpleType name="RDCWebCustomer_Fields">
    - <xsd:restriction base="xsd:string">
    <xsd:enumeration value="No" />
    <xsd:enumeration value="Name" />
    <xsd:enumeration value="Address" />
    <xsd:enumeration value="City" />
    <xsd:enumeration value="Post_Code" />
    <xsd:enumeration value="County" />
    <xsd:enumeration value="Salesperson_Code" />
    <xsd:enumeration value="Blocked" />
    <xsd:enumeration value="Salesperson_Name" />
    <xsd:enumeration value="Bill_to_Customer_No" />
    <xsd:enumeration value="Bill_To_Name" />
    <xsd:enumeration value="Bill_To_Address" />
    <xsd:enumeration value="Bill_To_City" />
    <xsd:enumeration value="Bill_To_Post_Code" />
    <xsd:enumeration value="Bill_To_County" />
    <xsd:enumeration value="Customer_Disc_Group" />
    <xsd:enumeration value="Customer_Price_Group" />
    <xsd:enumeration value="Payment_Method_Code" />
    <xsd:enumeration value="Payment_Method_Desc" />
    <xsd:enumeration value="Payment_Terms_Code" />
    <xsd:enumeration value="Payment_Terms_Desc" />
    <xsd:enumeration value="VAT_Registration_No" />
    <xsd:enumeration value="Fiscal_Code" />
    <xsd:enumeration value="Phone_No" />
    <xsd:enumeration value="Fax_No" />
    <xsd:enumeration value="E_Mail" />
    <xsd:enumeration value="Home_Page" />
    <xsd:enumeration value="Balance_LCY" />
    <xsd:enumeration value="Exposure_LCY" />
    <xsd:enumeration value="Issues_Find" />
    </xsd:restriction>
    </xsd:simpleType>
    - <xsd:complexType name="RDCWebCustomer_Filter">
    - <xsd:sequence>
    <xsd:element minOccurs="1" maxOccurs="1" name="Field" type="tns:RDCWebCustomer_Fields" />
    <xsd:element minOccurs="1" maxOccurs="1" name="Criteria" type="xsd:string" />
    </xsd:sequence>
    </xsd:complexType>
    - <xsd:element name="Read">
    - <xsd:complexType>
    - <xsd:sequence>
    <xsd:element minOccurs="1" maxOccurs="1" name="No" type="xsd:string" />
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    - <xsd:element name="Read_Result">
    - <xsd:complexType>
    - <xsd:sequence>
    <xsd:element minOccurs="0" maxOccurs="1" name="RDCWebCustomer" type="tns:RDCWebCustomer" />
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    - <xsd:element name="ReadByRecId">
    - <xsd:complexType>
    - <xsd:sequence>
    <xsd:element minOccurs="1" maxOccurs="1" name="recId" type="xsd:string" />
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    - <xsd:element name="ReadByRecId_Result">
    - <xsd:complexType>
    - <xsd:sequence>
    <xsd:element minOccurs="0" maxOccurs="1" name="RDCWebCustomer" type="tns:RDCWebCustomer" />
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    - <xsd:element name="ReadMultiple">
    - <xsd:complexType>
    - <xsd:sequence>
    <xsd:element minOccurs="1" maxOccurs="unbounded" name="filter" type="tns:RDCWebCustomer_Filter" />
    <xsd:element minOccurs="0" maxOccurs="1" name="bookmarkKey" type="xsd:string" />
    <xsd:element minOccurs="1" maxOccurs="1" name="setSize" type="xsd:int" />
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    - <xsd:element name="ReadMultiple_Result">
    - <xsd:complexType>
    - <xsd:sequence>
    <xsd:element minOccurs="0" maxOccurs="1" name="ReadMultiple_Result" type="tns:RDCWebCustomer_List" />
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    - <xsd:element name="IsUpdated">
    - <xsd:complexType>
    - <xsd:sequence>
    <xsd:element minOccurs="1" maxOccurs="1" name="Key" type="xsd:string" />
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    - <xsd:element name="IsUpdated_Result">
    - <xsd:complexType>
    - <xsd:sequence>
    <xsd:element minOccurs="1" maxOccurs="1" name="IsUpdated_Result" type="xsd:boolean" />
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    - <xsd:element name="GetRecIdFromKey">
    - <xsd:complexType>
    - <xsd:sequence>
    <xsd:element minOccurs="1" maxOccurs="1" name="Key" type="xsd:string" />
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    - <xsd:element name="GetRecIdFromKey_Result">
    - <xsd:complexType>
    - <xsd:sequence>
    <xsd:element minOccurs="1" maxOccurs="1" name="GetRecIdFromKey_Result" type="xsd:string" />
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    - <xsd:element name="Create">
    - <xsd:complexType>
    - <xsd:sequence>
    <xsd:element minOccurs="1" maxOccurs="1" name="RDCWebCustomer" type="tns:RDCWebCustomer" />
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    - <xsd:element name="Create_Result">
    - <xsd:complexType>
    - <xsd:sequence>
    <xsd:element minOccurs="1" maxOccurs="1" name="RDCWebCustomer" type="tns:RDCWebCustomer" />
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    - <xsd:element name="CreateMultiple">
    - <xsd:complexType>
    - <xsd:sequence>
    <xsd:element minOccurs="1" maxOccurs="1" name="RDCWebCustomer_List" type="tns:RDCWebCustomer_List" />
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    - <xsd:element name="CreateMultiple_Result">
    - <xsd:complexType>
    - <xsd:sequence>
    <xsd:element minOccurs="1" maxOccurs="1" name="RDCWebCustomer_List" type="tns:RDCWebCustomer_List" />
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    - <xsd:element name="Update">
    - <xsd:complexType>
    - <xsd:sequence>
    <xsd:element minOccurs="1" maxOccurs="1" name="RDCWebCustomer" type="tns:RDCWebCustomer" />
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    - <xsd:element name="Update_Result">
    - <xsd:complexType>
    - <xsd:sequence>
    <xsd:element minOccurs="1" maxOccurs="1" name="RDCWebCustomer" type="tns:RDCWebCustomer" />
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    - <xsd:element name="UpdateMultiple">
    - <xsd:complexType>
    - <xsd:sequence>
    <xsd:element minOccurs="1" maxOccurs="1" name="RDCWebCustomer_List" type="tns:RDCWebCustomer_List" />
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    - <xsd:element name="UpdateMultiple_Result">
    - <xsd:complexType>
    - <xsd:sequence>
    <xsd:element minOccurs="1" maxOccurs="1" name="RDCWebCustomer_List" type="tns:RDCWebCustomer_List" />
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    - <xsd:element name="Delete">
    - <xsd:complexType>
    - <xsd:sequence>
    <xsd:element minOccurs="1" maxOccurs="1" name="Key" type="xsd:string" />
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    - <xsd:element name="Delete_Result">
    - <xsd:complexType>
    - <xsd:sequence>
    <xsd:element minOccurs="1" maxOccurs="1" name="Delete_Result" type="xsd:boolean" />
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>
    </types>
    - <message name="Read">
    <part name="parameters" element="tns:Read" />
    </message>
    - <message name="Read_Result">
    <part name="parameters" element="tns:Read_Result" />
    </message>
    - <message name="ReadByRecId">
    <part name="parameters" element="tns:ReadByRecId" />
    </message>
    - <message name="ReadByRecId_Result">
    <part name="parameters" element="tns:ReadByRecId_Result" />
    </message>
    - <message name="ReadMultiple">
    <part name="parameters" element="tns:ReadMultiple" />
    </message>
    - <message name="ReadMultiple_Result">
    <part name="parameters" element="tns:ReadMultiple_Result" />
    </message>
    - <message name="IsUpdated">
    <part name="parameters" element="tns:IsUpdated" />
    </message>
    - <message name="IsUpdated_Result">
    <part name="parameters" element="tns:IsUpdated_Result" />
    </message>
    - <message name="GetRecIdFromKey">
    <part name="parameters" element="tns:GetRecIdFromKey" />
    </message>
    - <message name="GetRecIdFromKey_Result">
    <part name="parameters" element="tns:GetRecIdFromKey_Result" />
    </message>
    - <message name="Create">
    <part name="parameters" element="tns:Create" />
    </message>
    - <message name="Create_Result">
    <part name="parameters" element="tns:Create_Result" />
    </message>
    - <message name="CreateMultiple">
    <part name="parameters" element="tns:CreateMultiple" />
    </message>
    - <message name="CreateMultiple_Result">
    <part name="parameters" element="tns:CreateMultiple_Result" />
    </message>
    - <message name="Update">
    <part name="parameters" element="tns:Update" />
    </message>
    - <message name="Update_Result">
    <part name="parameters" element="tns:Update_Result" />
    </message>
    - <message name="UpdateMultiple">
    <part name="parameters" element="tns:UpdateMultiple" />
    </message>
    - <message name="UpdateMultiple_Result">
    <part name="parameters" element="tns:UpdateMultiple_Result" />
    </message>
    - <message name="Delete">
    <part name="parameters" element="tns:Delete" />
    </message>
    - <message name="Delete_Result">
    <part name="parameters" element="tns:Delete_Result" />
    </message>
    - <portType name="RDCWebCustomer_Port">
    - <operation name="Read">
    <input name="Read" message="tns:Read" />
    <output name="Read_Result" message="tns:Read_Result" />
    </operation>
    - <operation name="ReadByRecId">
    <input name="ReadByRecId" message="tns:ReadByRecId" />
    <output name="ReadByRecId_Result" message="tns:ReadByRecId_Result" />
    </operation>
    - <operation name="ReadMultiple">
    <input name="ReadMultiple" message="tns:ReadMultiple" />
    <output name="ReadMultiple_Result" message="tns:ReadMultiple_Result" />
    </operation>
    - <operation name="IsUpdated">
    <input name="IsUpdated" message="tns:IsUpdated" />
    <output name="IsUpdated_Result" message="tns:IsUpdated_Result" />
    </operation>
    - <operation name="GetRecIdFromKey">
    <input name="GetRecIdFromKey" message="tns:GetRecIdFromKey" />
    <output name="GetRecIdFromKey_Result" message="tns:GetRecIdFromKey_Result" />
    </operation>
    - <operation name="Create">
    <input name="Create" message="tns:Create" />
    <output name="Create_Result" message="tns:Create_Result" />
    </operation>
    - <operation name="CreateMultiple">
    <input name="CreateMultiple" message="tns:CreateMultiple" />
    <output name="CreateMultiple_Result" message="tns:CreateMultiple_Result" />
    </operation>
    - <operation name="Update">
    <input name="Update" message="tns:Update" />
    <output name="Update_Result" message="tns:Update_Result" />
    </operation>
    - <operation name="UpdateMultiple">
    <input name="UpdateMultiple" message="tns:UpdateMultiple" />
    <output name="UpdateMultiple_Result" message="tns:UpdateMultiple_Result" />
    </operation>
    - <operation name="Delete">
    <input name="Delete" message="tns:Delete" />
    <output name="Delete_Result" message="tns:Delete_Result" />
    </operation>
    </portType>
    - <binding name="RDCWebCustomer_Binding" type="tns:RDCWebCustomer_Port">
    <binding transport="http://schemas.xmlsoap.org/soap/http&quot; xmlns="http://schemas.xmlsoap.org/wsdl/soap/&quot; />
    - <operation name="Read">
    <operation soapAction="urn:microsoft-dynamics-schemas/page/rdcwebcustomer:Read" style="document" xmlns="http://schemas.xmlsoap.org/wsdl/soap/&quot; />
    - <input name="Read">
    <body use="literal" xmlns="http://schemas.xmlsoap.org/wsdl/soap/&quot; />
    </input>
    - <output name="Read_Result">
    <body use="literal" xmlns="http://schemas.xmlsoap.org/wsdl/soap/&quot; />
    </output>
    </operation>
    - <operation name="ReadByRecId">
    <operation soapAction="urn:microsoft-dynamics-schemas/page/rdcwebcustomer:ReadByRecId" style="document" xmlns="http://schemas.xmlsoap.org/wsdl/soap/&quot; />
    - <input name="ReadByRecId">
    <body use="literal" xmlns="http://schemas.xmlsoap.org/wsdl/soap/&quot; />
    </input>
    - <output name="ReadByRecId_Result">
    <body use="literal" xmlns="http://schemas.xmlsoap.org/wsdl/soap/&quot; />
    </output>
    </operation>
    - <operation name="ReadMultiple">
    <operation soapAction="urn:microsoft-dynamics-schemas/page/rdcwebcustomer:ReadMultiple" style="document" xmlns="http://schemas.xmlsoap.org/wsdl/soap/&quot; />
    - <input name="ReadMultiple">
    <body use="literal" xmlns="http://schemas.xmlsoap.org/wsdl/soap/&quot; />
    </input>
    - <output name="ReadMultiple_Result">
    <body use="literal" xmlns="http://schemas.xmlsoap.org/wsdl/soap/&quot; />
    </output>
    </operation>
    - <operation name="IsUpdated">
    <operation soapAction="urn:microsoft-dynamics-schemas/page/rdcwebcustomer:IsUpdated" style="document" xmlns="http://schemas.xmlsoap.org/wsdl/soap/&quot; />
    - <input name="IsUpdated">
    <body use="literal" xmlns="http://schemas.xmlsoap.org/wsdl/soap/&quot; />
    </input>
    - <output name="IsUpdated_Result">
    <body use="literal" xmlns="http://schemas.xmlsoap.org/wsdl/soap/&quot; />
    </output>
    </operation>
    - <operation name="GetRecIdFromKey">
    <operation soapAction="urn:microsoft-dynamics-schemas/page/rdcwebcustomer:GetRecIdFromKey" style="document" xmlns="http://schemas.xmlsoap.org/wsdl/soap/&quot; />
    - <input name="GetRecIdFromKey">
    <body use="literal" xmlns="http://schemas.xmlsoap.org/wsdl/soap/&quot; />
    </input>
    - <output name="GetRecIdFromKey_Result">
    <body use="literal" xmlns="http://schemas.xmlsoap.org/wsdl/soap/&quot; />
    </output>
    </operation>
    - <operation name="Create">
    <operation soapAction="urn:microsoft-dynamics-schemas/page/rdcwebcustomer:Create" style="document" xmlns="http://schemas.xmlsoap.org/wsdl/soap/&quot; />
    - <input name="Create">
    <body use="literal" xmlns="http://schemas.xmlsoap.org/wsdl/soap/&quot; />
    </input>
    - <output name="Create_Result">
    <body use="literal" xmlns="http://schemas.xmlsoap.org/wsdl/soap/&quot; />
    </output>
    </operation>
    - <operation name="CreateMultiple">
    <operation soapAction="urn:microsoft-dynamics-schemas/page/rdcwebcustomer:CreateMultiple" style="document" xmlns="http://schemas.xmlsoap.org/wsdl/soap/&quot; />
    - <input name="CreateMultiple">
    <body use="literal" xmlns="http://schemas.xmlsoap.org/wsdl/soap/&quot; />
    </input>
    - <output name="CreateMultiple_Result">
    <body use="literal" xmlns="http://schemas.xmlsoap.org/wsdl/soap/&quot; />
    </output>
    </operation>
    - <operation name="Update">
    <operation soapAction="urn:microsoft-dynamics-schemas/page/rdcwebcustomer:Update" style="document" xmlns="http://schemas.xmlsoap.org/wsdl/soap/&quot; />
    - <input name="Update">
    <body use="literal" xmlns="http://schemas.xmlsoap.org/wsdl/soap/&quot; />
    </input>
    - <output name="Update_Result">
    <body use="literal" xmlns="http://schemas.xmlsoap.org/wsdl/soap/&quot; />
    </output>
    </operation>
    - <operation name="UpdateMultiple">
    <operation soapAction="urn:microsoft-dynamics-schemas/page/rdcwebcustomer:UpdateMultiple" style="document" xmlns="http://schemas.xmlsoap.org/wsdl/soap/&quot; />
    - <input name="UpdateMultiple">
    <body use="literal" xmlns="http://schemas.xmlsoap.org/wsdl/soap/&quot; />
    </input>
    - <output name="UpdateMultiple_Result">
    <body use="literal" xmlns="http://schemas.xmlsoap.org/wsdl/soap/&quot; />
    </output>
    </operation>
    - <operation name="Delete">
    <operation soapAction="urn:microsoft-dynamics-schemas/page/rdcwebcustomer:Delete" style="document" xmlns="http://schemas.xmlsoap.org/wsdl/soap/&quot; />
    - <input name="Delete">
    <body use="literal" xmlns="http://schemas.xmlsoap.org/wsdl/soap/&quot; />
    </input>
    - <output name="Delete_Result">
    <body use="literal" xmlns="http://schemas.xmlsoap.org/wsdl/soap/&quot; />
    </output>
    </operation>
    </binding>
    - <service name="RDCWebCustomer_Service">
    - <port name="RDCWebCustomer_Port" binding="tns:RDCWebCustomer_Binding">
    <address location="http://nav2009.renodevelop.office:7047/StdReno2009SP1_RDC/WS/Test MM/Page/RDCWebCustomer&quot; xmlns="http://schemas.xmlsoap.org/wsdl/soap/&quot; />
    </port>
    </service>
    </definitions>
  • HanenHanen Member Posts: 281

    ou must have something like :
    RDCWebCustomer_Service CustSce = new RDCWebCustomer_Service();
    Regards

    Hanen TALBI
  • marco.morrealemarco.morreale Member Posts: 58
    This is exactly what I am missing when I switch to "service reference" mode.

    I added two service:
    - CustomerWS as a Web Reference
    - TestService as a Service Reference

    You see that for CustomerWS I have RDCWebCustomer_Service but for TestService I haven't.

    Here is my code:
    5511967156_9b5785c358.jpg
  • HanenHanen Member Posts: 281
    Try PageService and not TestService in this case
    Regards

    Hanen TALBI
  • marco.morrealemarco.morreale Member Posts: 58
    Ok, thanks.
    Anyway, do you confirm that you are using "Service Reference" instead of "Web Reference"?
    Maybe I've got something wrong in my NAV Service setup.
    Thank you very much for your answers.
    Marco
  • HanenHanen Member Posts: 281
    Let me see, you are using Service Reference and not Web Reference????
    if you are consuming (calling) a navision web Service in WCF Project you have to add it as web reference and not as a service reference.
    Regards

    Hanen TALBI
  • marco.morrealemarco.morreale Member Posts: 58
    Ok, now I got you.
    You mean that you are working on a WCF project to produce web services, but INSIDE your project, you are using NAV Services as "WEB Reference" and not "Service Reference" (as I am doing).

    I was asking why we cannot use NAV Services as "Service Reference" while it seems "Web reference" and asmx are deprecated by Microsoft in favour of "Service Reference and WCF.

    If so, why Microsoft publish NAV web service through an absolete technology?
    M
  • HanenHanen Member Posts: 281
    Yes exactly. :thumbsup:
    Maybe this can help you to know the difference between Web Reference and a Service Reference.

    http://andrewtokeley.net/archive/2008/07/10/the-difference-between-ldquoadd-web-referencerdquo-and-ldquoadd-service-referencerdquo.aspx
    Regards

    Hanen TALBI
  • MajesticMajestic Member Posts: 10
    I know this is a old post, but i feel like im sitting in the same problem. Im trying to locate the .Read method, but i cannot for the love of god find it. Im trying to get my Update method to work, im trying to do this:
    hi,

    First you have read the record which you want to delete by using read and then pass the whole key values to the delete command.
    Service x = new Service();
                a y = new a();
                y.Code = Txt1.Text;
                y = x.Read(y.Code);
                x.Update(ref y);
               
    

    but it just wont work:

    my code looks like this, for now... this just sends the data to my C# code so i can see the data, but i cant edit it:
     BMGWS ws = new BMGWS();
                Vogn vogn = new Vogn();
    
    
                ws.UseDefaultCredentials = true;
                ws.SendVogn("BMG 2013", false, ref vogn);
    
                foreach (VognType c in vogn.Vogn1)
                {
                    Console.WriteLine();
                    Console.WriteLine(c.Beskrivelse);
                    Console.WriteLine(c.Kode);
                    Console.WriteLine(c.RegNr);
                    Console.WriteLine(c.Spaerret);
                    Console.WriteLine();
                }
    
Sign In or Register to comment.