C# API Access Unrecognized message version

jspatton1971
Kilo Explorer

Adding some automation to how virtual servers are provisioned here and I noticed some odd behavior and am hoping someone can help me out.

 

                       System.ServiceModel.EndpointAddress RemoteAddress = new System.ServiceModel.EndpointAddress(ServiceNowPath);
                       System.ServiceModel.BasicHttpBinding myBinding = new System.ServiceModel.BasicHttpBinding("ServiceNowSoap");
                       ServiceNowSoapClient client = new ServiceNowSoapClient(myBinding, RemoteAddress);

I pass in the path the cmdb_ci_server.do?WSDL and when the insert happens I receive the error above, unrecognized message version

 

If I just use the instance of service-now that I created my reference from my code just works. I'd like to be able to allow someone to pass in their specific instance of service now into the code, and apparently i'm doing it wrong.

 

For the record, the code above is using the same instance as my service reference exactly so, I think i'm missing something in how I construct this.

 

Thanks in advance!

1 REPLY 1

jspatton1971
Kilo Explorer

So, turns out the issue I was having was with the format of the URL coming in. In the original post you'll see that I end with ?WSDL and it should be ?SOAP. Once I made that change I was able to pass in the url of a given instance and have it just work...so far.