I
IanT
I have a problem where i would like to send the same object to 2 or
more different webservices which accept objects with exactly the same
structure. I realise that if we'd been wise we would have used the
same WSDL for each and i will do for future Development but for the
moment i have to consume a clients Service and have to make the best
of what i have.
The problem seems to be in the namespaces. Even though the objects are
structurally exactly the same they are obviously treated as different
types.
I would like to be able to convert a standard object so i can pass it
to both Services and hence avoid duplication.
To get around this i attempted to create a class which inherited from
a site specific class (from the proxy) and then populated itself from
a standard object but when i attempt to call the WebMethod i get the
following error.
"A first chance exception of type 'System.InvalidOperationException'
occurred in n-nbnq0s
Additional information: The type SSS_Generator.schemas.MyType was not
expected. Use the XmlInclude or SoapInclude attribute to specify types
that are not known statically."
This problem is generated by the WebProxy - it never actually gets
sent to the Web Service.
At the moment the only solution open to me is to write a function to
populate the class generated by the WebProxy from another standard
class which is structurally identical.
Does anyone have any other ideas?
many thanks
Ian
more different webservices which accept objects with exactly the same
structure. I realise that if we'd been wise we would have used the
same WSDL for each and i will do for future Development but for the
moment i have to consume a clients Service and have to make the best
of what i have.
The problem seems to be in the namespaces. Even though the objects are
structurally exactly the same they are obviously treated as different
types.
I would like to be able to convert a standard object so i can pass it
to both Services and hence avoid duplication.
To get around this i attempted to create a class which inherited from
a site specific class (from the proxy) and then populated itself from
a standard object but when i attempt to call the WebMethod i get the
following error.
"A first chance exception of type 'System.InvalidOperationException'
occurred in n-nbnq0s
Additional information: The type SSS_Generator.schemas.MyType was not
expected. Use the XmlInclude or SoapInclude attribute to specify types
that are not known statically."
This problem is generated by the WebProxy - it never actually gets
sent to the Web Service.
At the moment the only solution open to me is to write a function to
populate the class generated by the WebProxy from another standard
class which is structurally identical.
Does anyone have any other ideas?
many thanks
Ian