SBX - Search With Button

SBX - Forum Post Title

Visual Studio 2015 adding ODATA Web Service as a Service Reference error

Microsoft Dynamics NAV Forum

gnilsen asked a question on 14 Sep 2018 3:30 PM

Question Status

Suggested Answer

We currently have NAV 2018 installed and I am trying to use an ODATA web service in VS 2015 by creating a Service Reference.  I am currently receiving this error: 

So when entering the Address in the Service Reference I use this format: https://hostname:port/instance/OData/  We are using SSL, so I don't know if this makes a difference.  We are also using NavUserPassword to login.  What is interesting is that after hitting Go on the Address it prompts me for my credentials 3 times.  Once the 3rd time is complete it seems to grab the information.  I can see my web services endpoints that I set up in NAV.  But once I hit ok on the Service Reference window it looks like it is trying to set it up and then errors out with the above message.  Also, on another note, on this same machine if I go to IE,Chrome, or Edge I put in the https://hostname:port/instance/OData/ and it prompts me for my credentials and I enter them, it shows the Web Service information just fine.

Is there anyone that has any input on how to get past this error?  Could this be something with VS2015? Could this be with a setup with NAV? I tried to recreated this issue on a local computer with a self signed SSL and Using NavUserPassword and I was able to set up my Service Reference just fine.  

I've searched online and I haven't found anything that has helped us yet. Any help would be appreciated.

Thanks.

Reply
Suresh Kulla responded on 14 Sep 2018 3:36 PM
Suggested Answer

Can you view the services from Web Browser ? also try running VS as administrator

Reply
gnilsen responded on 14 Sep 2018 4:07 PM

Suresh,

Thank you for the reply.  Yes, when I go to a web browser and use this format: https://hostname:port/instance/OData/ I get asked for my credentials once, I enter them, and then it works.  

I have also tried to run as administrator as well as a different user such as the Service Account User that the Service Instance uses.  No luck on those either.  Any other ideas?

Reply
Suresh Kulla responded on 14 Sep 2018 8:12 PM
Suggested Answer

Did you try the SOAP url ? Does that work ?

Reply

If this happens after adding the service reference in Visual Studio, right click the service reference and select Update Service Reference.

Reply
gnilsen responded on 17 Sep 2018 10:37 AM

So when trying to do Update Service Reference I get this error message:

So then I closed the solution and reopened it.  

Did the Update Service Reference and it once again asked for my credentials 3 times.  Once it connects and I click okay it gives me this message:

Any other ideas?

Thanks so much for taking time to help me figure this out.

Reply
gnilsen responded on 17 Sep 2018 10:39 AM

So I tried soap and it worked.  I had to used the full link that was provided within NAV Web Services and I was able to create the Service Reference.  So Soap works but Odata does not.  We are wanting to use Odata though.

Reply
Suresh Kulla responded on 14 Sep 2018 3:36 PM
Suggested Answer

Can you view the services from Web Browser ? also try running VS as administrator

Reply
Suresh Kulla responded on 14 Sep 2018 8:12 PM
Suggested Answer

Did you try the SOAP url ? Does that work ?

Reply

SBX - Two Col Forum

SBX - Migrated JS