Monday, March 15, 2010

Possible SOAP version mismatch: Envelope namespace http://schemas.xmlsoap.org/wsdl/ was unexpected. Expecting http://schemas.xmlsoap.org/soap/envelope

problem:
I added webreference for crmservice
http://server/mscrmservices/2007/crmservice.asmx?wsdl&uniquename=organization
and it redirected to
http://server/mscrmservices/2007/crmservicewsdl.aspx?uniquename=organization
thats how crmservice works
but when using CrmService.Retrieve method i got the error

"Possible SOAP version mismatch: Envelope namespace http://schemas.xmlsoap.org/wsdl/ was unexpected. Expecting http://schemas.xmlsoap.org/soap/envelope"

solution:
when setting url property CrmService service
we should use
http://server/mscrmservices/2007/crmservice.asmx?wsdl&uniquename=organization
and not
http://server/mscrmservices/2007/crmservicewsdl.aspx?uniquename=organization

we will not get that error

No comments: