Please publish the response that comes back from the server (using fiddler).
If what you published above is the response then the server url returns a WSDL file instead of a SOAP envelope. One reason may be that you are using a wrong url for the run time.
If you will publish the full WSDL I can see what url appears inside it.
Also check if there is any working client at all for this service (even a php one) so we can see what is the difference between what it sends and what you send.
yinung@oksta...
Member
11 Points
56 Posts
Possible SOAP version mismatch
Nov 04, 2008 09:32 PM|LINK
I added a web service into an ASP web application,
after I ran the application and called the web service,
the web page showed following message:
Possible SOAP version mismatch: Envelope namespace http://schemas.xmlsoap.org/disco/ was unexpected. Expecting http://schemas.xmlsoap.org/soap/envelope/.
---------------------------------------------------------------------------
I do not understand what is the problem.
Thanks everyone who tries to help me.
yaronn01
Contributor
2754 Points
414 Posts
Re: Possible SOAP version mismatch
Nov 04, 2008 11:02 PM|LINK
Also use a tool like Fiddler to capture the messages that are sent and received and publish them here.
Web Services Performance, Interoperability And Testing Blog
yinung@oksta...
Member
11 Points
56 Posts
Re: Possible SOAP version mismatch
Nov 05, 2008 03:04 PM|LINK
I found there is different thing from regular consuming web service,
the url of adding web service which I wanna add is https://xxxxxxxxxx/xxx/soap.php?wsdl , it is a php file
in the text book, regular url of adding web reference is http://xxxx/xxxx/something.asmx , it is web service file
Would this be the problem?
however, when I added https://xxxxxxxxxx/xxx/soap.php?wsdl this php file, I also can see how many methods appear on
add web reference page
yaronn01
Contributor
2754 Points
414 Posts
Re: Possible SOAP version mismatch
Nov 05, 2008 04:13 PM|LINK
Use the url without this extension.
Publish the SOAP you traced with fiddler here.
Web Services Performance, Interoperability And Testing Blog
yinung@oksta...
Member
11 Points
56 Posts
Re: Possible SOAP version mismatch
Nov 05, 2008 06:19 PM|LINK
Thank you for your patient.
I re-add the web reference and also took off "?wsdl", but I still get the same massege after I called the web service.
Following is the information from Fiddler:
Auth:
No Proxy-Authorization Header is present.
No Authorization Header is present.
Raw:
POST /UAS/soap.php HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 2.0.50727.1433)
VsDebuggerCausalityData: uIDPo7jRFDVAD65EltQaR4Xof9UAAAAAm2FGH2UxkEOUN5vpCLge0ibOKWiLh4JDs4R4/1QbiREACAAA
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://soapinterop.org/"
Host: staging2.it.okstate.edu
Content-Length: 628
Expect: 100-continue
Connection: Keep-Alive
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Header><preauth xmlns="http://soapinterop.org/xsd"><Username>ldapguide</Username><Password>20Ldapguide</Password><AuthSource>AD</AuthSource></preauth></soap:Header><soap:Body><getHostbridge xmlns="http://soapinterop.org/xsd"><Username>carbart</Username><SAName>SCTT</SAName><HB_USER>fim</HB_USER><HB_PASS>10Fim2008</HB_PASS><attributes>system;hrs:region;sctt</attributes></getHostbridge></soap:Body></soap:Envelope>
TextView:
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Header><preauth xmlns="http://soapinterop.org/xsd"><Username>ldapguide</Username><Password>20Ldapguide</Password><AuthSource>AD</AuthSource></preauth></soap:Header><soap:Body><getHostbridge xmlns="http://soapinterop.org/xsd"><Username>carbart</Username><SAName>SCTT</SAName><HB_USER>fim</HB_USER><HB_PASS>10Fim2008</HB_PASS><attributes>system;hrs:region;sctt</attributes></getHostbridge></soap:Body></soap:Envelope>
yinung@oksta...
Member
11 Points
56 Posts
Re: Possible SOAP version mismatch
Nov 05, 2008 06:21 PM|LINK
Thank you for your patient.
I re-add the web reference, and took off "?wsdl", but I still got the same information after I called that web service.
There is information from Fiddler:
TextView:
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Header><preauth xmlns="http://soapinterop.org/xsd"><Username>ldapguide</Username><Password>20Ldapguide</Password><AuthSource>AD</AuthSource></preauth></soap:Header><soap:Body><getHostbridge xmlns="http://soapinterop.org/xsd"><Username>carbart</Username><SAName>SCTT</SAName><HB_USER>fim</HB_USER><HB_PASS>10Fim2008</HB_PASS><attributes>system;hrs:region;sctt</attributes></getHostbridge></soap:Body></soap:Envelope>
Raw:
POST /UAS/soap.php HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 2.0.50727.1433)
VsDebuggerCausalityData: uIDPo7jRFDVAD65EltQaR4Xof9UAAAAAm2FGH2UxkEOUN5vpCLge0ibOKWiLh4JDs4R4/1QbiREACAAA
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://soapinterop.org/"
Host: staging2.it.okstate.edu
Content-Length: 628
Expect: 100-continue
Connection: Keep-Alive
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Header><preauth xmlns="http://soapinterop.org/xsd"><Username>ldapguide</Username><Password>20Ldapguide</Password><AuthSource>AD</AuthSource></preauth></soap:Header><soap:Body><getHostbridge xmlns="http://soapinterop.org/xsd"><Username>carbart</Username><SAName>SCTT</SAName><HB_USER>fim</HB_USER><HB_PASS>10Fim2008</HB_PASS><attributes>system;hrs:region;sctt</attributes></getHostbridge></soap:Body></soap:Envelope>
yaronn01
Contributor
2754 Points
414 Posts
Re: Possible SOAP version mismatch
Nov 05, 2008 07:16 PM|LINK
Can you share also the response? mainly I want to know if the server throws this exception or the client when handling the server response.
Additionaly if you can share the WSDL we can see what soap versions are expected and what url is specified inside it.
Also - do you have any working client at all to this service? even a php one. We could compare what the working and non-working clients send.
Web Services Performance, Interoperability And Testing Blog
yinung@oksta...
Member
11 Points
56 Posts
Re: Possible SOAP version mismatch
Nov 06, 2008 09:21 PM|LINK
Yes, the error message is from my code:
catch(System.Web.Services.Protocols.SoapException ex) {Response.Write(ex.Message.ToString());
}
and this code return the message:
Possible SOAP version mismatch: Envelope namespace http://schemas.xmlsoap.org/disco/ was unexpected. Expecting http://schemas.xmlsoap.org/soap/envelope/.
Otherwise, the WSDL is :
<?xml version="1.0" encoding="utf-8"?><
definitions xmlns:tns="http://soapinterop.org/SOAP_Auth_Wrapper" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd1="http://soapinterop.org/xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="SOAP_Auth_Wrapper" targetNamespace="http://soapinterop.org/SOAP_Auth_Wrapper" xmlns="http://schemas.xmlsoap.org/wsdl/"> <types> <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" elementFormDefault="qualified" targetNamespace="http://soapinterop.org/xsd"><
xsd:complexType name="HeaderStruct">=============================================
I saw other web site says if the envelope namespace url is "http://schemas.xmlsoap.org/soap/envelope/", the wsdl should be SOAP version 1.1,
and this url is match the error message "Expecting http://schemas.xmlsoap.org/soap/envelope/"
So I guess the wsdl is SOAP 1.1 , however, I don't know how can I fix it.
Moreover, in the caching section of Fiddler, it says:
Response headers do not contain caching-related directives.
Thank you so much.
yaronn01
Contributor
2754 Points
414 Posts
Re: Possible SOAP version mismatch
Nov 06, 2008 10:09 PM|LINK
Please publish the response that comes back from the server (using fiddler).
If what you published above is the response then the server url returns a WSDL file instead of a SOAP envelope. One reason may be that you are using a wrong url for the run time.
If you will publish the full WSDL I can see what url appears inside it.
Also check if there is any working client at all for this service (even a php one) so we can see what is the difference between what it sends and what you send.
Web Services Performance, Interoperability And Testing Blog
yinung@oksta...
Member
11 Points
56 Posts
Re: Possible SOAP version mismatch
Nov 07, 2008 01:29 PM|LINK
I am very sorry about I don't know where is the response information from server by using Fiddler.
and I don't know if there is any working client for this service.
Here is the full WSDL:
<?xml version="1.0" encoding="utf-8"?><
definitions xmlns:tns="http://soapinterop.org/SOAP_Auth_Wrapper" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd1="http://soapinterop.org/xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="SOAP_Auth_Wrapper" targetNamespace="http://soapinterop.org/SOAP_Auth_Wrapper" xmlns="http://schemas.xmlsoap.org/wsdl/"> <types><
xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" elementFormDefault="qualified" targetNamespace="http://soapinterop.org/xsd"> <xsd:complexType name="HeaderStruct"><
xsd:sequence> <xsd:element name="Username" type="xsd:string" /><
xsd:element name="Password" type="xsd:string" /> <xsd:element name="AuthSource" type="xsd:string" /></
xsd:sequence> </xsd:complexType><
xsd:complexType name="Group"> <xsd:sequence><
xsd:element name="ID" type="xsd:int" /> <xsd:element name="Name" type="xsd:string" /><
xsd:element name="Parent_ID" type="xsd:int" /> </xsd:sequence></
xsd:complexType> <xsd:complexType name="ArrayOfGroup"><
xsd:sequence> <xsd:element minOccurs="0" maxOccurs="unbounded" name="Group" type="xsd1:Group" /></
xsd:sequence> </xsd:complexType><
xsd:element name="preauth" type="xsd1:HeaderStruct" /> <xsd:element name="preauthResponse" type="xsd:string" /><
xsd:element name="authUser"> <xsd:complexType><
xsd:sequence> <xsd:element name="Username" type="xsd:string" /><
xsd:element name="Password" type="xsd:string" /> </xsd:sequence></
xsd:complexType> </xsd:element><
xsd:element name="getUniqueID" type="xsd:string" /> <xsd:element name="getAttribute"><
xsd:complexType> <xsd:sequence><
xsd:element name="Username" type="xsd:string" /> <xsd:element name="Attribute" type="xsd:string" /></
xsd:sequence> </xsd:complexType></
xsd:element> <xsd:element name="getGroups"><
xsd:complexType> <xsd:sequence><
xsd:element name="Username" type="xsd:string" /> <xsd:element name="Appname" type="xsd:string" /></
xsd:sequence> </xsd:complexType></
xsd:element> <xsd:element name="getHostbridge"><
xsd:complexType> <xsd:sequence><
xsd:element name="Username" type="xsd:string" /> <xsd:element name="SAName" type="xsd:string" /><
xsd:element name="HB_USER" type="xsd:string" /> <xsd:element name="HB_PASS" type="xsd:string" /><
xsd:element name="attributes" type="xsd:string" /> </xsd:sequence></
xsd:complexType> </xsd:element><
xsd:complexType name="SingleItem"> <xsd:simpleContent><
xsd:extension base="xsd:string" /> </xsd:simpleContent></
xsd:complexType> <xsd:complexType name="ArrayOfItem"><
xsd:sequence> <xsd:element minOccurs="0" maxOccurs="unbounded" name="Item" nillable="true" type="xsd1:SingleItem" /></
xsd:sequence> </xsd:complexType><
xsd:element name="authUserResponse" type="xsd:boolean" /> <xsd:element name="getUniqueIDResponse" type="xsd:string" /><
xsd:element name="getAttributeResponse"> <xsd:complexType><
xsd:sequence> <xsd:element minOccurs="0" maxOccurs="1" name="Values" type="xsd1:ArrayOfItem" /></
xsd:sequence> </xsd:complexType></
xsd:element> <xsd:element name="getGroupsResponse" type="xsd1:ArrayOfGroup" /><
xsd:element name="getHostbridgeResponse" type="xsd:string" /> </xsd:schema></
types> <message name="authUserRequest"><
part name="params" element="xsd1:authUser" /> </message><
message name="authUserResponse"> <part name="result" element="xsd1:authUserResponse" /></
message> <message name="getUniqueIDRequest"><
part name="params" element="xsd1:getUniqueID" /> </message><
message name="getUniqueIDResponse"> <part name="result" element="xsd1:getUniqueIDResponse" /></
message> <message name="getAttributeRequest"><
part name="params" element="xsd1:getAttribute" /> </message><
message name="getAttributeResponse"> <part name="result" element="xsd1:getAttributeResponse" /></
message> <message name="getGroupsRequest"><
part name="params" element="xsd1:getGroups" /> </message><
message name="getGroupsResponse"> <part name="result" element="xsd1:getGroupsResponse" /></
message> <message name="getHostbridgeRequest"><
part name="params" element="xsd1:getHostbridge" /> </message><
message name="getHostbridgeResponse"> <part name="result" element="xsd1:getHostbridgeResponse" /></
message> <message name="preauthRequest"><
part name="preauth" element="xsd1:preauth" /> </message><
message name="preuthResponse"> <part name="output" element="xsd1:preauthResponse" /></
message> <portType name="SOAP_Auth_WrapperPortType"><
operation name="authUser"> <input name="authUserRequest" message="tns:authUserRequest" /><
output name="authUserResponse" message="tns:authUserResponse" /> </operation><
operation name="getUniqueID"> <input name="getUniqueIDRequest" message="tns:getUniqueIDRequest" /><
output name="getUniqueIDResponse" message="tns:getUniqueIDResponse" /> </operation><
operation name="getAttribute"> <input name="getAttributeRequest" message="tns:getAttributeRequest" /><
output name="getAttributeResponse" message="tns:getAttributeResponse" /> </operation><
operation name="getGroups"> <input name="getGroupsRequest" message="tns:getGroupsRequest" /><
output name="getGroupsResponse" message="tns:getGroupsResponse" /> </operation><
operation name="getHostbridge"> <input name="getHostbridgeRequest" message="tns:getHostbridgeRequest" /><
output name="getHostbridgeResponse" message="tns:getHostbridgeResponse" /> </operation></
portType> <binding name="SOAP_Auth_WrapperPortBinding" type="tns:SOAP_Auth_WrapperPortType"><
soap:binding transport="http://schemas.xmlsoap.org/soap/http" /> <operation name="authUser"><
soap:operation soapAction="http://soapinterop.org/" style="document" /> <input name="authUserRequest"><
soap:body use="literal" namespace="http://soapinterop.org/SOAP_Auth_Wrapper" /> <soap:header message="tns:preauthRequest" part="preauth" use="literal" /></
input> <output name="authUserResponse"><
soap:body use="literal" namespace="http://soapinterop.org/SOAP_Auth_Wrapper" /> </output></
operation> <operation name="getUniqueID"><
soap:operation soapAction="http://soapinterop.org/" style="document" /> <input name="getUniqueIDRequest"><
soap:body use="literal" namespace="http://soapinterop.org/SOAP_Auth_Wrapper" /> <soap:header message="tns:preauthRequest" part="preauth" use="literal" /></
input> <output name="getUniqueIDResponse"><
soap:body use="literal" namespace="http://soapinterop.org/SOAP_Auth_Wrapper" /> </output></
operation> <operation name="getAttribute"><
soap:operation soapAction="http://soapinterop.org/" style="document" /> <input name="getAttributeRequest"><
soap:body use="literal" namespace="http://soapinterop.org/SOAP_Auth_Wrapper" /> <soap:header message="tns:preauthRequest" part="preauth" use="literal" /></
input> <output name="getAttributeResponse"><
soap:body use="literal" namespace="http://soapinterop.org/SOAP_Auth_Wrapper" /> </output></
operation> <operation name="getGroups"><
soap:operation soapAction="http://soapinterop.org/" style="document" /> <input name="getGroupsRequest"><
soap:body use="literal" namespace="http://soapinterop.org/SOAP_Auth_Wrapper" /> <soap:header message="tns:preauthRequest" part="preauth" use="literal" /></
input> <output name="getGroupsResponse"><
soap:body use="literal" namespace="http://soapinterop.org/SOAP_Auth_Wrapper" /> </output></
operation> <operation name="getHostbridge"><
soap:operation soapAction="http://soapinterop.org/" style="document" /> <input name="getHostbridgeRequest"><
soap:body use="literal" namespace="http://soapinterop.org/SOAP_Auth_Wrapper" /> <soap:header message="tns:preauthRequest" part="preauth" use="literal" /></
input> <output name="getHostbridgeResponse"><
soap:body use="literal" namespace="http://soapinterop.org/SOAP_Auth_Wrapper" /> </output></
operation> </binding><
service name="SOAP_Auth_WrapperService"> <port name="SOAP_Auth_WrapperPort" binding="tns:SOAP_Auth_WrapperPortBinding"><
soap:address location="http://staging2.it.okstate.edu/UAS/soap.php" /> </port></
service></
definitions>