I'm facing a problem when trying to generate a proxy client in C# .Net 4.0 for the webservice defined by this wsdl: link (I'm not managing this service and it seems to be an Axis2 MTOM Java based service)
Here is the generator feedback:
1):
Details: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.DataContractSerializerMessageContractImporter
Error: Object reference not set to an instance of an object.
XPath to the source of error: //wsdl:definitions[@targetNamespace='http://sls.ws.coliposte.fr']/wsdl:portType[@name='ServiceV3WS']
2):
Error: Unable to import wsdl:binding
Detail: An error occurred while importing wsdl:portType which depends wsdl:binding.
XPath to wsdl:portType: //wsdl:definitions[@targetNamespace='http://sls.ws.coliposte.fr']/wsdl:portType[@name='ServiceV3WS']
XPath to the source of error: //wsdl:definitions[@targetNamespace='http://sls.ws.coliposte.fr']/wsdl:binding[@name='SlsServiceWSSoapBinding']
3):
Error: Unable to import wsdl:port
Detail: An error occurred while importing wsdl:binding which depends wsdl:port.
XPath to wsdl:binding: //wsdl:definitions[@targetNamespace='http://sls.ws.coliposte.fr']/wsdl:binding[@name='SlsServiceWSSoapBinding']
XPath to the source of error: //wsdl:definitions[@targetNamespace='http://sls.ws.coliposte.fr']/wsdl:service[@name='SlsServiceWS']/wsdl:port[@name='SlsServiceWSPort']
- These errors seem cryptic to me, but it seems the errors 2 and 3 depend from the error 1. So my hypothesis was first this service was not compliant (for instance,
portType
was not defined with the right path). So I tried to validate it using a wsdl validator (I tried wsdl-analyzer.com) and it returns me that all was OK. - So my second hypothesis was that I generate the proxy in a wrong way:
- I tried using the "standard WCF way" via the "add service reference" menu option from Visual Studio (2012).
- I also try generate a client proxy using svcutil.exe (v 4.0.30319.xxx). Obviously, it returns the same errors. (It seems svcutil is used in backend by VS.)
What I expect:
Well, I've seen many related questions on SO about this kind of proxy generation. But my main problem is I don't really understand what is the actual problem. So I decide to post a new question to request explanation about these errors: what do they mean, why such errors appear and what are the alternative ways/tools to generate such proxy.
So this is my first post on SO so feel free to review and comment.
Thank you by advance and see you.