'Able to add SOAP Service (ASXM?Wsdl) as a Web Reference, but not Service Reference

I am working on upgrading some of our legacy applications from .Net Framework over to .Net 6, and I'm encountering a bit of friction while trying to generate classes from our web services. If I go into Visual Studio 2017, and I add a Web Reference, pointed at our web service, it works as expected. However, if I attempt to use the command-line tool, or I use the service reference tools in Visual Studio 2017 (or newer), I receive errors about it unable to resolve a certain schema object.

Specifically, it's complaining about this chunk in our wsdl:

<wsdl:message name="LoginSessionID">
<wsdl:part xmlns:q1="http://www.CENSORED.com/webservices/encodedTypes" name="SessionID" type="q1:SessionID"/>
</wsdl:message>
<wsdl:message name="LoginSoapIn">
<wsdl:part name="parameters" element="tns:Login"/>
</wsdl:message>
<wsdl:message name="LoginSoapOut">
<wsdl:part name="parameters" element="tns:LoginResponse"/>
</wsdl:message>
<wsdl:message name="LogoutSessionID">
<wsdl:part xmlns:q2="http://www.CENSORED.com/webservices/encodedTypes" name="SessionID" type="q2:SessionID"/>
</wsdl:message>
<wsdl:message name="LogoutSoapIn">
<wsdl:part name="parameters" element="tns:Logout"/>
</wsdl:message>
<wsdl:message name="LogoutSoapOut">
<wsdl:part name="parameters" element="tns:LogoutResponse"/>
</wsdl:message>

And the error I receive is:

Error: Schema with target namespace 'http://www.CENSORED.com/webservices/encodedTypes' could not be found

The error is somewhat self-explanatory, but I'm unsure how to resolve it. I'm not opposed to using it as a Web Reference, but I do not know how that will play with .Net 6.

Any ideas?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source