I have 4 portals (WW, EU, AU, US), every one of them has its own web service (through PHP which means I do not have control over).
For those 4 web services, I have 4 clients (generated by VS.Net Add Web Reference).
There is a method called CommonMethod
it is the same on all web services, returns an object of type CommonClass
.
- When I call that method (using EU proxy class) I am getting an InvalidOperationException
There is an error in XML document (2, 615).
, and the InnerException says "Cannot assign object of type NS.com.AU.CommonClass to an object of type NS.com.EU.CommonClass.". - When I call that method (using US proxy class) I am getting an InvalidOperationException
There is an error in XML document (2, 615).
, and the InnerException says "Cannot assign object of type NS.com.AU.CommonClass to an object of type NS.com.US.CommonClass.". - When I call that method (using AU proxy class), No exception is thrown.
- When I call that method (using WW proxy class) I am getting an InvalidOperationException
There is an error in XML document (2, 615).
, and the InnerException says "Cannot assign object of type NS.com.AU.CommonClass to an object of type NS.com.WW.CommonClass.".
I searched the web for such error, well it is XML so a lot of irrelevant stuff comes up and could not find something useful.
Now I noticed, the 4 web services are using the same namespace in their WSDL documents (xmlns:tns="urn:rambo.com:RamboComApi"). Can this be the source of confusion and type-casting exception? Should I tell the authors of the web services to choose different namespace for each web service?