Possible SOAP version mismatch
I have a problem with web service connection. It says,
Possible SOAP version mismatch: Envelope namespace http://schemas.xmlsoap.org/wsdl/ was unexpected. Expecting http://schemas.xmlsoap.org/soap/envelope/.
when i call webservice's method. Do you hav开发者_开发问答e any idea about my problem?
It looks like you're providing the wrong namespace when creating the SOAP envelope - it should look similar to this:
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
It's the third one that is probably wrong in your case.
I ran into the same issue dealing with a legacy web service hosted on a mainframe(obviously not .net). The url for the service was specified in the config of the client, but the wsdl file had not been included in the deployment. I suspect that on the initial call, the .Net client attempted to retrieve a fresh wsdl. The service wasn't expecting that and we received the "Possible SOAP version mismatch" error.
We encountered this error, because we set the c#-WebServiceProxy-URL to a wrong value.
we did
WebService ws = new WebService();
ws.Url = "http://URL_TO_WEBSERVICE?WSDL";
var response = ws.CallFunction()
Here the ?WSDL at the end of the URL caused the error.
精彩评论