Unable to Add Web Reference

LaurieDiffey 6 Reputation points
2022-12-16T12:06:44.253+00:00

Hi,

I'm hoping somebody can help me with an issue I'm having adding a web service. I last worked with this particular web service several few years ago, but the steps I used previously no longer seem to work. I should also say that I haven't been a proper developer for many years, so apologies in advance if anything I say is incorrect

The endpoint I'm trying to connect to is sat behind a firewall for which my IP address has been whitelisted, but if I access the endpoint's WSDL through a web browser, it returns the WSDL correctly. I have downloaded the WSDL XML and added it as an attachment here.

In Visual Studio Community 2022, I can click Add Service Reference, then Advanced, and then Add Web Reference, and I can then enter the URL for the WSDL. However, I then get an error message as below (also attached as an image):

There was an error downloading 'https://jwl3mrkq7dgb4xztli32etivg40uahbs.lambda-url.eu-central-1.on.aws/SessionManager.svc?wsdl/$metadata'. The request failed with HTTP status 400: Bad Request.[271385-sessionmanagerwsdl.xml

Thinking the issue might be with Visual Studio, I tried loading the WSDL into SoapUI, which worked correctly. However, when I then tried to have SoapUI generate .Net code (which uses Microsoft's WSDL.EXE) I then got this error:

  • The document at the url https://jwl3mrkq7dgb4xztli32etivg40uahbs.lambda-url.eu-central-1.on.aws/SessionManager.svc?wsdl was not recognized as a known document type.
    The error message from each known type may help you fix the problem:
    • Report from 'XML Schema' is '' ', hexadecimal value 0x1F, is an invalid character. Line 1, position 1.'.
    • Report from 'DISCO Document' is '' ', hexadecimal value 0x1F, is an invalid character. Line 1, position 1.'.
    • Report from 'WSDL Document' is 'There is an error in XML document (1, 1).'.
  • ' ', hexadecimal value 0x1F, is an invalid character. Line 1, position 1.

I don't understand the line "hexadecimal value 0x1F, is an invalid character. Line 1, position 1" as this isn't true!!

In summary, I need to be able to add the endpoint as a web reference to have Visual Studio generate the methods, etc, for me. I know this worked when I last used it (probably 10 years ago) in an earlier version of Visual Studio, but I can't get it to work now. By the way, the endpoint is from a third party, so I have no control of their endpoint or its WSDL

Can anybody help me to resolve this issue so I can load the web reference into Visual Studio

Thanks very much in advance for any pointers

LD

Developer technologies Visual Studio Other
{count} vote

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.