Calling Web Services

smaheshwarismaheshwari Member Posts: 5
edited 2012-06-07 in NAV Three Tier
I have added Customer Card Page as in Web Service form 810 and place a check mark on Published.
Then I checked web service availablity by entering the address http://localhost:7047/DynamicsNAV/WS/services in the Internet Explorer and it is working fine.
Now I m trying to call web service through Visual C#.
I am trying to add service by "Add service Reference".
In Add Service Reference Window I wrote the address http://localhost:7047/DynamicsNAV/WS/services
but I got the following error.

Metadata contains a reference that cannot be resolved: 'http://localhost:7047/DynamicsNAV/WS/Page/Customer_List'.
There was an error downloading 'http://localhost:7047/DynamicsNAV/WS/Page/Customer_List'.
The request failed with the error message:
--
<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.Types.Exceptions.NavReadDeniedPermissionException</faultcode><faultstring xml:lang="en-US">You do not have permission to read the Profile table.</faultstring><detail><string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">You do not have permission to read the Profile table.</string></detail></s:Fault></s:Body></s:Envelope>
--.
Metadata contains a reference that cannot be resolved: 'http://localhost:7047/DynamicsNAV/WS/services'.
The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'NTLM'.
The remote server returned an error: (401) Unauthorized.
If the service is defined in the current solution, try building the solution and adding the service reference again.


Please suggest me any solution.....
Sarika Maheshwari
Navision Consultant

Comments

  • Ashish_GuptaAshish_Gupta Member Posts: 56
    ok its fine you have check web services by http://localhost:7047/DynamicsNAV/WS/services this path , then you will see that there are multiple paths for different services use these paths to call services....
    Ashish Gupta
    Navision Technical Consultant
  • smaheshwarismaheshwari Member Posts: 5
    I want to register and consume a page web service.
    Sarika Maheshwari
    Navision Consultant
  • jimclarkusjimclarkus Member Posts: 25
    I have added Customer Card Page as in Web Service form 810 and place a check mark on Published.
    Then I checked web service availablity by entering the address http://localhost:7047/DynamicsNAV/WS/services in the Internet Explorer and it is working fine.
    Now I m trying to call web service through Visual C#.
    I am trying to add service by "Add service Reference".
    In Add Service Reference Window I wrote the address http://localhost:7047/DynamicsNAV/WS/services
    but I got the following error.

    Metadata contains a reference that cannot be resolved: 'http://localhost:7047/DynamicsNAV/WS/Page/Customer_List'.
    There was an error downloading 'http://localhost:7047/DynamicsNAV/WS/Page/Customer_List'.
    The request failed with the error message:
    --
    <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.Types.Exceptions.NavReadDeniedPermissionException</faultcode><faultstring xml:lang="en-US">You do not have permission to read the Profile table.</faultstring><detail><string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">You do not have permission to read the Profile table.</string></detail></s:Fault></s:Body></s:Envelope>
    --.
    Metadata contains a reference that cannot be resolved: 'http://localhost:7047/DynamicsNAV/WS/services'.
    The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'NTLM'.
    The remote server returned an error: (401) Unauthorized.
    If the service is defined in the current solution, try building the solution and adding the service reference again.


    Please suggest me any solution.....

    You had given user id and pass check user role or assign user as super user
    Thank You
  • smaheshwarismaheshwari Member Posts: 5
    Yes I have assign Super role to user
    Sarika Maheshwari
    Navision Consultant
  • chrisgrill3chrisgrill3 Member Posts: 18
    After you add the reference have you set the credentials for your web service object to use?
    ie: reference.WebService foo = new reference.WebService;
    foo.Credentials = new System.Net.NetworkCredential("User","password","DOMAIN");
    We had similar problems unitl we did that correctly.
  • smaheshwarismaheshwari Member Posts: 5
    Thank you for the reply..

    But I have this problem when I add the service reference.

    When I place this address http://localhost:7047/DynamicsNAV/WS/services in Add service reference window and click on GO then I get error!

    When I published a page(Standard or Customized) or Codeunit(standard) as a Web service I got the error. But When I published a Customized Codeunit then I didn't get any error. I could easily get the codeunit method.
    Sarika Maheshwari
    Navision Consultant
  • anshpat2826anshpat2826 Member Posts: 44
    did you solved problem or not?
    did you check the link in Internet explorer.?
    Himanshu Patel
    Navision Consultant(Technical and Functional)
    Phone No: 09979876474
    Email : anshpat2826@gmail.com
  • shrekutshrekut Member Posts: 27
    Check to make sure the Microsoft Dynamics NAV Business Web Services is running. Also; check the CustomSettings.config settings to make sure they are point to the server and database you have the Page running as a Web Service in. These have tripped me up recently in this same area. The odd thing was after renaming a company the Microsoft Dynamics NAV Business Web Services shut down.
  • knightknight Member Posts: 45
    Also, you should be adding a Web Reference, not a Service Reference.
  • absolutelyfreewebabsolutelyfreeweb Member Posts: 104
    I believe it is a problem with web reference as well.
    Did you solve this?
  • chethanhtchethanht Member Posts: 14
    Can you please check eventlog on the Nav Server machine and see if you get any info from there?
Sign In or Register to comment.