472,973 Members | 2,266 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,973 software developers and data experts.

Can you custom format a SoapHeader By Attributes?

I've written a complex web service in C# to be used by SmartDevices and I'm
trying to reduce size of the message to the absolute minimum to save on cost,
every byte counts etc.

Is there any way to custom format the SoapHeader by Attributes in the Web
service or SoapHeader class?

For simplicity look at the example below...

public DeviceAuthenticationHeader DeviceHeader;

[SoapHeader("DeviceHeader", Direction = SoapHeaderDirection.InOut)]
[WebMethod]
public void SimpleMethod()
{
}

produces

<soap:Header>
<DeviceAuthenticationHeader xmlns="http://www.namespace.net/">
<MessageID>guid</MessageID>
<DeviceIdentifier>string</DeviceIdentifier>
<Password>string</Password>
</DeviceAuthenticationHeader>
</soap:Header>

where by I'm trying to achieve

<soap:Header>
<DH xmlns="http://www.namespace.net/">
<id>guid</id>
<uid>string</uid>
<pwd>string</pwd>
</DH >
</soap:Header>

I know I can just change the class name / properties to achieve the same
result but I'm keen on maintaining my class name and properties.

I've achieved id, uid and pwd by the use of Xml serialisation

[SoapElement("mid")]
[XmlElement("mid")]

but my web reference in the SmartDevice now replaces MessageID with mid so
again I lose my class property name.

Ideally I would want my SoapHeader properties to remain the same on web
service and device

Can this be done?

Cheers in advance
Aug 8 '06 #1
0 1082

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Matthew Harvey | last post by:
Hello, I am having a problem getting a custom soap header to work with PHP5. What I require is something like this: <SOAP-ENV:Header> <USER>myusername</USER> <PASSWORD>mypassword</PASSWORD>...
3
by: StGo | last post by:
How can i read/write file's custom attributs(like subject,author...) in C#??? Thanks :))
4
by: Wiktor Zychla | last post by:
Hello, for some reason I need to use attributes in ILAsm code and read these attributes in C# code. My problem is with the attribute declaration inside ILAsm code. I know that I define any...
2
by: Jay Walker | last post by:
I created a custom DataGridColumn based on Marcie Robillard's MSDN Article: Creating Custom Columns for the ASP.NET Datagrid...
1
by: Eric | last post by:
Hi, I have a WebService client. All the code is generated by VS.NET 2003. The problem is that some attributes are not generated. All the attributes in the base class are generated. But the...
2
by: Mike Fiedler | last post by:
On a client web services request, I have a SoapExtension that is adding a header to the message in the BeforeSerialize stage. If the Web Service request is for an operation with...
2
by: prabhupr | last post by:
Hi Folks I was reading this article (http://www.dotnetbips.com/articles/displayarticle.aspx?id=32) on "Custom Attribute", written by Bipin. The only thing I did not understand in this article...
10
by: Andy Kendall | last post by:
I have a problem accessing my custom SoapHeader from a SoapExtension. My extension has no compile time reference to the class derived from SoapHeader, so how can cast it into a SoapHeader of the...
0
by: Fred | last post by:
I am trying to build a consumer to a webservice which use soapheader. I am using Visual Studio 2003. Please see the wsdl-file below. Why is it that the SOAPHEADER is empty when I use it int the...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.