Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > XmlXxxAttribute() not working at all in Soap Header (Desperate)

Reply
Thread Tools

XmlXxxAttribute() not working at all in Soap Header (Desperate)

 
 
Emul
Guest
Posts: n/a
 
      12-12-2005
I am having trouble getting the XmlXxxAttributes to work in a C# web
service. I have tried everything possible and am at my wit's end. I
see many examples and none work. I can even copy code from MSDN or
microsoft.public.dotnet.framework.webservices and it does not work.
Is this a known problem with VS 7.1.3088 or .NET 1.1.4322? For
instance, XmlAttributeAttribute() or XmlTextAttribute() do absolutely
nothing different than if those lines were missing. The code is below.
If you look at the two attributes toward the bottom (in red) they
should have an impact on the output. Yet whether they are present or
not, the Id and Text come out as elements, not as an attribute and
literal text. (I'm watching the request with a network sniffer just to
be sure.) Thank you so very much in advance.

using System;
using System.Web.Services.Protocols;
using System.ComponentModel;
using System.Web.Services;

[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("c ode")]
[System.Web.Services.WebServiceBindingAttribute(Nam e="IPServiceSoapBinding",
Namespace="http://flf0001826d7077/services/IPService")]
public class IPServiceService :
System.Web.Services.Protocols.SoapHttpClientProtoc ol {

public NetxHeader NetxHeaderValue = new NetxHeader();

public IPServiceService()
{
this.Url = http://flf0001826d7077/services/IPService;
}

[System.Web.Services.Protocols.SoapHeaderAttribute( "NetxHeaderValue",
Direction=SoapHeaderDirection.In)]
[System.Web.Services.Protocols.SoapRpcMethoddttribu te("",
RequestNamespace="http://webservice.imageportal.products.netxposure.com",
ResponseNamespace="http://flf0001826d7077/services/IPService")]
[return:
System.Xml.Serialization.SoapElementAttribute("get AssetFileReturn",
DataType="base64Binary")]
public System.Byte[] getAssetFile(int in0) {
object[] results = this.Invoke("getAssetFile", new object[]
{in0});
return ((System.Byte[])(results[0]));
}

// other (currently uinused) methods omitted

[System.Xml.Serialization.SoapTypeAttribute("NetxHe ader",
"urn:http://www.netxposure.com/exogen")]
public class NetxHeader : SoapHeader
{
[System.Xml.Serialization.XmlAttributeAttribute("Id ",
Namespace="http://schemas.xmlsoap.org/WS/2002/07/utility")]
public string Id;
[System.Xml.Serialization.XmlTextAttribute()]
public string[] Text;
}}

main()
{
// ...

IPServiceService NetxService = new IPServiceService();
NetxService.NetxHeaderValue.Id = "Id_Test";
NetxService.NetxHeaderValue.Text = new string [1];
NetxService.NetxHeaderValue.Text[0] = "<test>test</test>";
outBytes = NetxService.getAssetFile(2);
// etc.
}

 
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
Header files with "header.h" or <header.h> ?? mlt C++ 2 01-31-2009 02:54 PM
How to add SOAP header to a SOAP message? Peter van der veen ASP .Net Web Services 6 11-14-2006 06:44 PM
Soap Extension problem (seems that soap request is not sent to server) Frederik Vanderhaegen ASP .Net Web Services 0 10-20-2006 09:18 AM
SOAP Header Not Sent If Exception Thrown David Hayward via .NET 247 ASP .Net Web Services 0 05-23-2005 09:34 PM
To SOAP or Not To SOAP? mooseshoes XML 3 09-21-2003 04:38 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57