D
Desmond Fitzgerald
We have a document-literal style web service that we provide to a number
of external parties.
The input is a create applicant request document with some structured
customer details including xs:date and bool elements.
The problem occurs when we add a web reference to this service and try
to invoke it using the generated proxies. The serialized request is
missing some of the elements.
When I looked further into this it seems that the generated classes in
Reference.cs have a number of xxxSpecified properties and fields
corresponding to members such as date of births and some of the boolean
flags.
However, when you set the DOB field, for example, it does not set the
DOBSpecified flag to true. Then it appears that XMLSerializer will not
serialize the associated property.
I am using XSDObjectGen to generate the server-side classes and these do
not exhibit the same problem. They set the xxxSpecified flags correctly.
The java tools I have tried also process the WSDL correctly and there is
nothing wrong with the Schema.
Obviously, I have a number of options to fix the client side proxies
such as:
1. Rewrite the Reference.cs in terms of the XSDObjectGen classes.
2. Add statements to Reference.cs to set the specified flags properly.
The problem is that some of our clients will be using VS and it is
highly inconvenient to have them do this every time they update the Web
Reference.
To help them I could:
* Provide a script that does (2) above.
* Provide a class that introspects the request at run-time and sets the
specified flags properly.
Again, I would rather not have to do this. Having to kludge things like
this is making the RPC style look attractive again!
Does anyone know how I can sort this out properly. It seems like a bug
in wsdl.exe?
of external parties.
The input is a create applicant request document with some structured
customer details including xs:date and bool elements.
The problem occurs when we add a web reference to this service and try
to invoke it using the generated proxies. The serialized request is
missing some of the elements.
When I looked further into this it seems that the generated classes in
Reference.cs have a number of xxxSpecified properties and fields
corresponding to members such as date of births and some of the boolean
flags.
However, when you set the DOB field, for example, it does not set the
DOBSpecified flag to true. Then it appears that XMLSerializer will not
serialize the associated property.
I am using XSDObjectGen to generate the server-side classes and these do
not exhibit the same problem. They set the xxxSpecified flags correctly.
The java tools I have tried also process the WSDL correctly and there is
nothing wrong with the Schema.
Obviously, I have a number of options to fix the client side proxies
such as:
1. Rewrite the Reference.cs in terms of the XSDObjectGen classes.
2. Add statements to Reference.cs to set the specified flags properly.
The problem is that some of our clients will be using VS and it is
highly inconvenient to have them do this every time they update the Web
Reference.
To help them I could:
* Provide a script that does (2) above.
* Provide a class that introspects the request at run-time and sets the
specified flags properly.
Again, I would rather not have to do this. Having to kludge things like
this is making the RPC style look attractive again!
Does anyone know how I can sort this out properly. It seems like a bug
in wsdl.exe?