473,782 Members | 2,437 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SoapHeaders added from within SoapExtension have 'tempuri' namespace

Hi,

I have a SoapExtension that adds a SoapHeader to all outboundmessage s. 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:SoapMessag e.Headers.add(m yHeader).

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

<soap:Header><m yHeader soap:actor="myA ctor"xmlns="htt p://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>bCa5SLVQaEy yB+OjM8Hd7w==</Id>
Nov 23 '05 #1
1 2166
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.Hea ders.add(myHead er).

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

<soap:Header><m yHeader soap:actor="myA ctor" 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>bCa5SLVQaEy yB+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
3611
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 ServiceId, Soap Request, Start Time, End Time etc. to the database. I need to get the Id of the row the SoapExtension inserts into the database from within the Web Method. (The web method sends a
1
1279
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
1544
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
5608
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 content, not even by changing browser encoding setting to the appropriate one. I implemented SoapExtension (called EncodingExtension) to rewrite the xml to change the encoding="utf-8" to encoding="windows-1252" in BeforeDeserialize SoapMessage...
0
2470
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 configuration (getting a ConfigurationException complaining about a valid type name). The following is the coded DebugExtension which extends SoapExtension
1
1133
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 object is on the Action property. This maps to the namespace property on the soapAction property of the operation element. For VS-generated web services this is OK - the overall target namespace and the namespace on the soapAction will usually be...
10
2222
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 correct type? Thanks, Andy
3
2665
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 http://tempuri.org/ then attach .xsd to the end
2
1655
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 System.ComponentModel ' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
0
9639
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10146
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10080
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9942
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8967
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6733
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5378
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5509
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2874
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.