Use XML attributes to specify another XML name or namespace...

W

Web Developer

I've written a ServiceDescriptionFormatExtension that is used by my custom
SoapExtensionReflector so that I can add an authorization header to each web
service in my environment. In order for the update to work, I need the
following header added to the input and output sections of each service
operation of the wsdl:

<soap:header message="s0:AddRequesterIdentityHeader"
part="RequesterIdentityHeader" use="literal" />

The error below occurs when I use the following attribute on my custom
ServiceDescriptionFormatExtension:
<XmlFormatExtension("header", "http://schemas.xmlsoap.org/wsdl/soap/",
GetType(OutputBinding), GetType(InputBinding))> _

Here's the error:
System.InvalidOperationException:
There was an error reflecting type
'System.Web.Services.Description.ServiceDescription'. --->
System.InvalidOperationException: There was an error reflecting property
'Bindings'. --->
System.InvalidOperationException: There was an error reflecting type
'System.Web.Services.Description.Binding'. --->
System.InvalidOperationException: There was an error reflecting property
'Operations'. --->
System.InvalidOperationException: There was an error reflecting type
'System.Web.Services.Description.OperationBinding'. --->
System.InvalidOperationException: There was an error reflecting property
'Input'. --->
System.InvalidOperationException: There was an error reflecting type
'System.Web.Services.Description.InputBinding'. --->
System.InvalidOperationException: There was an error reflecting property
'Extensions'. --->
System.InvalidOperationException:
The XML element named 'header' from namespace
'http://schemas.xmlsoap.org/wsdl/soap/' references distinct types
System.Web.Services.Description.SoapHeaderBinding and (my custom
ServiceDescriptionFormatExtension class).
Use XML attributes to specify another XML name or namespace for the element
or types.
at
System.Xml.Serialization.XmlReflectionImporter.ReconcileAccessor(ElementAccessor accessor)
at
System.Xml.Serialization.XmlReflectionImporter.ReconcileLocalAccessor(ElementAccessor accessor, String ns)
at
System.Xml.Serialization.XmlReflectionImporter.ImportAccessorMapping(MemberMapping
accessor, FieldModel model, XmlAttributes a, String ns, Type
choiceIdentifierType)
at
System.Xml.Serialization.XmlReflectionImporter.ImportFieldMapping(StructModel
parent, FieldModel model, XmlAttributes a, String ns)
at
System.Xml.Serialization.XmlReflectionImporter.ImportStructLikeMapping(StructModel model, String ns)
--- End of inner exception stack trace ---
at
System.Xml.Serialization.XmlReflectionImporter.ImportStructLikeMapping(StructModel model, String ns)
at
System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping(TypeModel
model, String ns, ImportContext context, String dataType, Boolean repeats)
--- End of inner exception stack trace ---
at
System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping(TypeModel
model, String ns, ImportContext context, String dataType, Boolean repeats)
at
System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping(TypeModel
model, String ns, ImportContext context, String dataType)
at
System.Xml.Serialization.XmlReflectionImporter.ImportAccessorMapping(MemberMapping
accessor, FieldModel model, XmlAttributes a, String ns, Type
choiceIdentifierType)
at
System.Xml.Serialization.XmlReflectionImporter.ImportFieldMapping(StructModel
parent, FieldModel model, XmlAttributes a, String ns)
at
System.Xml.Serialization.XmlReflectionImporter.ImportStructLikeMapping(StructModel model, String ns)
--- End of inner exception stack trace ---
at
System.Xml.Serialization.XmlReflectionImporter.ImportStructLikeMapping(StructModel model, String ns)
at
System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping(TypeModel
model, String ns, ImportContext context, String dataType, Boolean repeats)
--- End of inner exception stack trace ---
at
System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping(TypeModel
model, String ns, ImportContext context, String dataType, Boolean repeats)
at
System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping(TypeModel
model, String ns, ImportContext context, String dataType)
at
System.Xml.Serialization.XmlReflectionImporter.ImportAccessorMapping(MemberMapping
accessor, FieldModel model, XmlAttributes a, String ns, Type
choiceIdentifierType)
at
System.Xml.Serialization.XmlReflectionImporter.ImportFieldMapping(StructModel
parent, FieldModel model, XmlAttributes a, String ns)
at
System.Xml.Serialization.XmlReflectionImporter.ImportStructLikeMapping(StructModel model, String ns)
--- End of inner exception stack trace ---
at
System.Xml.Serialization.XmlReflectionImporter.ImportStructLikeMapping(StructModel model, String ns)
at
System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping(TypeModel
model, String ns, ImportContext context, String dataType, Boolean repeats)
--- End of inner exception stack trace ---
at
System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping(TypeModel
model, String ns, ImportContext context, String dataType, Boolean repeats)
at
System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping(TypeModel
model, String ns, ImportContext context, String dataType)
at
System.Xml.Serialization.XmlReflectionImporter.ImportAccessorMapping(MemberMapping
accessor, FieldModel model, XmlAttributes a, String ns, Type
choiceIdentifierType)
at
System.Xml.Serialization.XmlReflectionImporter.ImportFieldMapping(StructModel
parent, FieldModel model, XmlAttributes a, String ns)
at
System.Xml.Serialization.XmlReflectionImporter.ImportStructLikeMapping(StructModel model, String ns)
--- End of inner exception stack trace ---
at
System.Xml.Serialization.XmlReflectionImporter.ImportStructLikeMapping(StructModel model, String ns)
at
System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping(TypeModel
model, String ns, ImportContext context, String dataType, Boolean repeats)
--- End of inner exception stack trace ---
at
System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping(TypeModel
model, String ns, ImportContext context, String dataType, Boolean repeats)
at System.Xml.Serialization.XmlReflectionImporter.ImportElement(TypeModel
model, XmlRootAttribute root, String defaultNamespace)
at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping(Type
type, XmlRootAttribute root, String defaultNamespace)
at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping(Type
type, XmlRootAttribute root)
at System.Xml.Serialization.XmlSerializer..ctor(Type type,
XmlAttributeOverrides overrides, Type[] extraTypes, XmlRootAttribute root,
String defaultNamespace)
at System.Xml.Serialization.XmlSerializer..ctor(Type type,
XmlAttributeOverrides overrides)
at System.Web.Services.Description.ServiceDescription.get_Serializer()
at System.Web.Services.Protocols.DiscoveryServerType..ctor(Type type,
String uri)
at System.Web.Services.Protocols.DiscoveryServerProtocol.Initialize()
at System.Web.Services.Protocols.ServerProtocol.SetContext(Type type,
HttpContext context, HttpRequest request, HttpResponse response)
at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type,
HttpContext context, HttpRequest request, HttpResponse response, Boolean&
abortProcessing)


Is there another way to generate the soap:header entries in the wsdl? There
seems to be a namespace conflict when I try to add nodes from the
http://schemas.xmlsoap.org/wsdl/soap/ schema.

Thank you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,479
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top