473,395 Members | 1,681 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,395 software developers and data experts.

Webservices SOAP and Namespace prefixes

Hi all

I've got a webservices that will be called by a delphi product. They have
defined a soap message that they will use to call my webservice. A header
snippet is found below:
<soap:Header>
<mm:TheHeader xmlns:mm="http://The URL">
<SomeValue>123</SomeValue>
<AnotherValue>blabla</AnotherValue>
</mm:TheHeader >
</soap:Header>
I've defined a Class that inherits from SoapHeader, and added the SoapHeader
attribute to my webmethod, and included a public member of that type in my
webservice class.
No matter what I do, I can not get the header variable populated. I've even
used SoapUnknownHeader in my webmethod, but to no joy.
I've got a idea that it's got to do with the namespace prefix (mm) they are
using. I included the namespace specified in the header, but still no luck.
They are following the soap standard, and other companies are using their
product, so there is no option of changing the soap enevelope.
Is there any way that I can get the soapheader variable populated?

Thanks in advance

Nov 18 '05 #1
2 3633
I am not sure what you were looking for.
<%@ WebService language="C#" class="SoapHeaderTest" %>
using System;
using System.Xml;
using System.Xml.Serialization;
using System.Web.Services;
using System.Web.Services.Protocols;

[WebService(Namespace="urn:my-header-test")]
public class SoapHeaderTest
{
public MyHeader myHeader;

public SoapHeaderTest()
{
myHeader.myString = "Hello, there";
}

[SoapHeader ("myHeader",Direction=SoapHeaderDirection.InOut )]
[WebMethod]
public void MyMethod()
{
myHeader.myString = "Hello, from myMethod";
return;
}

[XmlRoot(Namespace="urn:my-header")]
public class MyHeader:SoapHeader
{
public string myString;
}
}
Here is something that seems to work for me. This sets the namespace info
correctly.
--
Girish Bharadwaj
http://msmvps.com/gbvb
"Corne Rabe" <Co*******@discussions.microsoft.com> wrote in message
news:25**********************************@microsof t.com...
Hi all

I've got a webservices that will be called by a delphi product. They have
defined a soap message that they will use to call my webservice. A header
snippet is found below:
<soap:Header>
<mm:TheHeader xmlns:mm="http://The URL">
<SomeValue>123</SomeValue>
<AnotherValue>blabla</AnotherValue>
</mm:TheHeader >
</soap:Header>
I've defined a Class that inherits from SoapHeader, and added the
SoapHeader
attribute to my webmethod, and included a public member of that type in my
webservice class.
No matter what I do, I can not get the header variable populated. I've
even
used SoapUnknownHeader in my webmethod, but to no joy.
I've got a idea that it's got to do with the namespace prefix (mm) they
are
using. I included the namespace specified in the header, but still no
luck.
They are following the soap standard, and other companies are using their
product, so there is no option of changing the soap enevelope.
Is there any way that I can get the soapheader variable populated?

Thanks in advance

Nov 18 '05 #2
Thanks for the quick reply Girish

I've got exactly the same code structure than what you recommended, but this
still does not solve my problem. If you look at the soap header in my initial
post, you will see the addition of a namespace prefix (mm) in the soap
header. This is what's causing the problem, because everything works fine if
I remove the namespace prefix, and use a normal default namespace declaration.
Nov 18 '05 #3

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

Similar topics

3
by: Johan Segernäs | last post by:
I'm put on building a system in Python and I haven't used either webservices, SOAP or Python so I'm a bit lost. This system will require callback functions, should I use Python thru Apache for...
0
by: Nalla | last post by:
Hi, I have a requirement to call webservices from my old C++ application.So first I tried with Vc++.net as follows.....There are 2 approach Dotnet frame work and soaptoolkit 3.0 I am not able to...
0
by: Michael Jackson | last post by:
I have attempted to mark up a service and it's methods so that it doesn't require the SOAPAction HTTP header to resolve the methods being called, this is done from first element in <SOAP-ENV:Body>...
4
by: Jinashe | last post by:
what do i need to enable accessing of webservices from a clients PC i'm hosting some webservices from my server in VB.NET. i've got some client windows applications done in VB.NET. what have i...
16
by: MR | last post by:
my soap messages to a remote site are failing. as far as i can tell the only differences between what my SOAP message looks liek and what they want are in the SOAP envelope SInce they don't have a...
0
by: Jigar.Patel | last post by:
I have simple remoting server exposing following simple method. When I try to add webreference to this server in another project, it gives me following error: Custom tool error: Unable to import...
10
by: smarty | last post by:
Hi, I have written a WSE in vis studio 2005 as and produced a dll that I can use in other projects by including the following in the web.config. <webservices> <soapextensiontypes> <add...
0
by: failfaizan | last post by:
I made a webservice but i got the following error: Custom tool error:Unable to import WebService/Schema.Unable to import binding. Is there any problem in my WSDL.Here is my WSDL file.Plz help me...
2
by: monsalvo | last post by:
What's so wrong with my code? This line is part of a VBScript soap client part of a DTS wich is functional in a 90 percent. strText = .responseXML.selectSingleNode("//" login "loginReturn") ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
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...

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.