Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Use XML attributes to specify another XML name or namespace...

Reply
Thread Tools

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

 
 
Web Developer
Guest
Posts: n/a
 
      02-17-2005
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.ServiceDescriptio n'. --->
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.Rec oncileAccessor(ElementAccessor accessor)
at
System.Xml.Serialization.XmlReflectionImporter.Rec oncileLocalAccessor(ElementAccessor accessor, String ns)
at
System.Xml.Serialization.XmlReflectionImporter.Imp ortAccessorMapping(MemberMapping
accessor, FieldModel model, XmlAttributes a, String ns, Type
choiceIdentifierType)
at
System.Xml.Serialization.XmlReflectionImporter.Imp ortFieldMapping(StructModel
parent, FieldModel model, XmlAttributes a, String ns)
at
System.Xml.Serialization.XmlReflectionImporter.Imp ortStructLikeMapping(StructModel model, String ns)
--- End of inner exception stack trace ---
at
System.Xml.Serialization.XmlReflectionImporter.Imp ortStructLikeMapping(StructModel model, String ns)
at
System.Xml.Serialization.XmlReflectionImporter.Imp ortTypeMapping(TypeModel
model, String ns, ImportContext context, String dataType, Boolean repeats)
--- End of inner exception stack trace ---
at
System.Xml.Serialization.XmlReflectionImporter.Imp ortTypeMapping(TypeModel
model, String ns, ImportContext context, String dataType, Boolean repeats)
at
System.Xml.Serialization.XmlReflectionImporter.Imp ortTypeMapping(TypeModel
model, String ns, ImportContext context, String dataType)
at
System.Xml.Serialization.XmlReflectionImporter.Imp ortAccessorMapping(MemberMapping
accessor, FieldModel model, XmlAttributes a, String ns, Type
choiceIdentifierType)
at
System.Xml.Serialization.XmlReflectionImporter.Imp ortFieldMapping(StructModel
parent, FieldModel model, XmlAttributes a, String ns)
at
System.Xml.Serialization.XmlReflectionImporter.Imp ortStructLikeMapping(StructModel model, String ns)
--- End of inner exception stack trace ---
at
System.Xml.Serialization.XmlReflectionImporter.Imp ortStructLikeMapping(StructModel model, String ns)
at
System.Xml.Serialization.XmlReflectionImporter.Imp ortTypeMapping(TypeModel
model, String ns, ImportContext context, String dataType, Boolean repeats)
--- End of inner exception stack trace ---
at
System.Xml.Serialization.XmlReflectionImporter.Imp ortTypeMapping(TypeModel
model, String ns, ImportContext context, String dataType, Boolean repeats)
at
System.Xml.Serialization.XmlReflectionImporter.Imp ortTypeMapping(TypeModel
model, String ns, ImportContext context, String dataType)
at
System.Xml.Serialization.XmlReflectionImporter.Imp ortAccessorMapping(MemberMapping
accessor, FieldModel model, XmlAttributes a, String ns, Type
choiceIdentifierType)
at
System.Xml.Serialization.XmlReflectionImporter.Imp ortFieldMapping(StructModel
parent, FieldModel model, XmlAttributes a, String ns)
at
System.Xml.Serialization.XmlReflectionImporter.Imp ortStructLikeMapping(StructModel model, String ns)
--- End of inner exception stack trace ---
at
System.Xml.Serialization.XmlReflectionImporter.Imp ortStructLikeMapping(StructModel model, String ns)
at
System.Xml.Serialization.XmlReflectionImporter.Imp ortTypeMapping(TypeModel
model, String ns, ImportContext context, String dataType, Boolean repeats)
--- End of inner exception stack trace ---
at
System.Xml.Serialization.XmlReflectionImporter.Imp ortTypeMapping(TypeModel
model, String ns, ImportContext context, String dataType, Boolean repeats)
at
System.Xml.Serialization.XmlReflectionImporter.Imp ortTypeMapping(TypeModel
model, String ns, ImportContext context, String dataType)
at
System.Xml.Serialization.XmlReflectionImporter.Imp ortAccessorMapping(MemberMapping
accessor, FieldModel model, XmlAttributes a, String ns, Type
choiceIdentifierType)
at
System.Xml.Serialization.XmlReflectionImporter.Imp ortFieldMapping(StructModel
parent, FieldModel model, XmlAttributes a, String ns)
at
System.Xml.Serialization.XmlReflectionImporter.Imp ortStructLikeMapping(StructModel model, String ns)
--- End of inner exception stack trace ---
at
System.Xml.Serialization.XmlReflectionImporter.Imp ortStructLikeMapping(StructModel model, String ns)
at
System.Xml.Serialization.XmlReflectionImporter.Imp ortTypeMapping(TypeModel
model, String ns, ImportContext context, String dataType, Boolean repeats)
--- End of inner exception stack trace ---
at
System.Xml.Serialization.XmlReflectionImporter.Imp ortTypeMapping(TypeModel
model, String ns, ImportContext context, String dataType, Boolean repeats)
at System.Xml.Serialization.XmlReflectionImporter.Imp ortElement(TypeModel
model, XmlRootAttribute root, String defaultNamespace)
at System.Xml.Serialization.XmlReflectionImporter.Imp ortTypeMapping(Type
type, XmlRootAttribute root, String defaultNamespace)
at System.Xml.Serialization.XmlReflectionImporter.Imp ortTypeMapping(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.DiscoveryServerProto col.Initialize()
at System.Web.Services.Protocols.ServerProtocol.SetCo ntext(Type type,
HttpContext context, HttpRequest request, HttpResponse response)
at System.Web.Services.Protocols.ServerProtocolFactor y.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.



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to specify attributes from code behind K Viltersten ASP .Net 5 08-07-2009 06:14 PM
obtain element name, or attribute and value of the document name itself, and some elemnts and attributes from an ancestor or the node itself using xquery Jeff Kish XML 4 10-30-2008 05:47 PM
Mailattachment - specify different file name? Chris Ashley ASP .Net 0 12-20-2005 10:42 AM
Get computer name by ip address (specify which DNS) =?Utf-8?B?Umlja3kgQ2hhbg==?= ASP .Net 0 03-02-2005 02:05 PM
can't specify new window attributes in IE Fred Javascript 0 05-14-2004 06:26 PM



Advertisments