Hi, I try to implement ASAP protocol in my web service, but I find a very
hard problem.
I define my SOAP Header:
[XmlTypeAttribute(Namespace="http://www.oasis-open.org/asap/0.9/asap.xsd")]
[XmlRootAttribute(Namespace="http://www.oasis-open.org/asap/0.9/asap.xsd",
IsNullable=false)]
public class Request : SoapHeader
{
[XmlElementAttribute(Form=XmlSchemaForm.Qualified, DataType="anyURI")]
public string ReplayTo;
[XmlElementAttribute(Form=XmlSchemaForm.Qualified, DataType="anyURI")]
public string From;
[XmlElementAttribute(Form=XmlSchemaForm.Qualified, DataType="anyURI")]
public string To;
[XmlElementAttribute(Form=XmlSchemaForm.Qualified, DataType="anyURI")]
public string MessageID;
[XmlElementAttribute(Form=XmlSchemaForm.Qualified, DataType="anyURI")]
public string Action;
[XmlElementAttribute(Form=XmlSchemaForm.Qualified, DataType="anyURI")]
public string RelatesTo;
}
but when I view WSDL of my web service i find:
<soap:Header>
<Request xmlns="http://www.oasis-open.org/asap/0.9/asap.xsd">
<ReplayTo>anyURI</ReplayTo>
<From>anyURI</From>
<To>anyURI</To>
<MessageID>anyURI</MessageID>
<Action>anyURI</Action>
<RelatesTo>anyURI</RelatesTo>
</Request>
</soap:Header>
This is wrong, because ASAP Header must be:
<soap:Header>
<ReplayTo>anyURI</ReplayTo>
<From>anyURI</From>
<To>anyURI</To>
<MessageID>anyURI</MessageID>
<Action>anyURI</Action>
<RelatesTo>anyURI</RelatesTo>
</soap:Header>
Please, someone have a solution? Thank you.
Max
François Lemaire - 18 Jul 2005 15:19 GMT
If I understand well your requirements, I think you should have one header
for ReplayTo, one for From, etc., not one big header containing all the
others ; SOAP headers are the elements immediatly under the soap:Header tag,
thus ReplayTo is a different header from the From header, in my opinion.
Moreover, some of these headers look like WS-Addressing headers. If this is
the case, you must precise the namespace.
Regards
François
PS : if I'm wrong about the headers, try removing the XmlRoot attribute or
putting its ElementName field to "" ; by default, this attribute uses the
class name as element name for XML serialization.