I have a hand-written WSDL, along with a few XSD files. A .NET client needs to load an XML document from disk and send its contents as part of the SOAP message. From what I've been reading I think I need to influence svcutil.exe or wsdl.exe to treat this part of the SOAP message as an XmlElement, rather than trying to create types for it.
Is the correct way to do this to specify part of the message as an <xs:any>
in the schema?
Is there another way that would allow me to properly specify the message in the schema without using <xs:any>
?
I have control over the WSDL and the Java service implementation, and somewhat less control over the WCF client.
Here's a sample message from the WSDL:
<wsdl:message name="TransmitFoo">
<wsdl:part name="body" element="someprefix:TransmitFooRequest"/>
</wsdl:message>
<wsdl:portType...>
<wsdl:operation name="TransmitFoo">
<wsdl:input message="tns:TransmitFoo">
</wsdl:operation>
</wsdl:portType>
The definition of TransmitFooRequest
from the schema is as follows:
<xs:element name="TransmitFooRequest">
<xs:complexType>
<xs:all>
<xs:element name="someValue" type="xs:string"/>
<xs:element ref="someprefix:bar" />
</xs:all>
</xs:complexType>
</xs:element>
<someprefix:bar>
is defined in the schema. This is the part that is loaded from disk. I'd like the generated WCF proxy class to have a method signature kind of like this:
TransmitFoo(String someValue, XmlElement bar)
I have seen an answer for a similar requirement where the WSDL is generated from the WCF server; I am doing the opposite, generating WCF client stubs from a WSDL.
I realize the client could also build the SOAP message and headers completely manually, as in another answer, but re-implementing SOAP is something I'd like to avoid.