473,405 Members | 2,279 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

SoapHeaders added from within SoapExtension have 'tempuri' namespace

Hi,

I have a SoapExtension that adds a SoapHeader to all outboundmessages. This works fine, but I don't see a way to control thenamespace of the emitted header. Here is what I'm doing:

I have created a subclass of SoapHeader ('MyHeader') and thisclass is in a defined namespace. I then create an instance ofthis class within my SoapExtension (also in a defined namespace)and add it to outbound messages using something like:SoapMessage.Headers.add(myHeader).

The soap messages coming out of my SoapExtension have the header,and they look like this:

<soap:Header><myHeader soap:actor="myActor"xmlns="http://tempuri.org/">

I need to place 'myHeader' into a real namespace. Is thispossible from within my SoapExtension, and how? I'd like avoiddoing this via the DOM if possible (I'm lazy!).

Thanks much,
Dave

--------------------------------
From: Dave Buxbaum

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>bCa5SLVQaEyyB+OjM8Hd7w==</Id>
Nov 23 '05 #1
1 2136
Dave Buxbaum via .NET 247 wrote:
Hi,

I have a SoapExtension that adds a SoapHeader to all outbound messages. This works fine, but I don't see a way to control the namespace of the emitted header. Here is what I'm doing:

I have created a subclass of SoapHeader ('MyHeader') and this class is in a defined namespace. I then create an instance of this class within my SoapExtension (also in a defined namespace) and add it to outbound messages using something like: SoapMessage.Headers.add(myHeader).

The soap messages coming out of my SoapExtension have the header, and they look like this:

<soap:Header><myHeader soap:actor="myActor" xmlns="http://tempuri.org/">

I need to place 'myHeader' into a real namespace. Is this possible from within my SoapExtension, and how? I'd like avoid doing this via the DOM if possible (I'm lazy!).

Thanks much,
Dave

--------------------------------
From: Dave Buxbaum

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>bCa5SLVQaEyyB+OjM8Hd7w==</Id>


Try using Xml serialization attributes on the custom header class (but I
did not test it, dont blame me if it doesn't work).

Regards
Rafal Gwizdala
Nov 23 '05 #2

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

Similar topics

3
by: Trevor Pinkney | last post by:
Hi, Is it possible to reference a custom SoapExtension instance from within a WebMethod? I have a SoapExtension used by several web-services for generic logging. The SoapExtension logs the...
1
by: alex bean | last post by:
How do i get them value of the web service namespace from inside a SoapExtension? For example my web service is defiend as: public class MyTest: WebService { public string HelloWorld(y)
0
by: Peter Theill | last post by:
I have these two web services: namespace WebService1 { public class Service1 : System.Web.Services.WebService { public Service1() { } public string HelloWorld() {
2
by: lprisr | last post by:
Hi, I have double byte characters in the content that I am returning using Web Services. However, the encoding in the xml file returned by Web Services is utf-8 and I am unable to read the...
0
by: Cameron | last post by:
Hi All, I've just written a small program to use a locally hosted webservice which works fine. However I've also written a SOAPExtension for the client and I'm having trouble with the...
1
by: Mike Fiedler | last post by:
I have a SoapExtension that needs to query the WSDL port namespace and operation namespace for the current message. As far as I can tell, the only namespace info available in the SoapMessage...
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...
3
markmcgookin
by: markmcgookin | last post by:
Hi, I know this is a common issue, but to be honest all the sites I find with solutions to this dont explain it well at all. I have a variable ($fileName) which I want to add to ...
2
by: cj | last post by:
What does the line <System.Web.Services.WebService(Namespace:="http://tempuri.org/")_ do in the example below? Imports System.Web.Services Imports System.Web.Services.Protocols Imports...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.