Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Webservices SOAP and Namespace prefixes

Reply
Thread Tools

Webservices SOAP and Namespace prefixes

 
 
=?Utf-8?B?Q29ybmUgUmFiZQ==?=
Guest
Posts: n/a
 
      10-26-2004
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

 
Reply With Quote
 
 
 
 
Girish bharadwaj
Guest
Posts: n/a
 
      10-26-2004
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" <> wrote in message
news:2545596C-60F5-416D-960A-...
> 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
>



 
Reply With Quote
 
 
 
 
=?Utf-8?B?Q29ybmUgUmFiZQ==?=
Guest
Posts: n/a
 
      10-26-2004
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.
 
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
XSLT exclude-result-prefixes not preventing namespace declaration in output Cameron McCormack XML 3 07-03-2007 12:06 AM
Apache Axis namespace prefixes??? jimmelonis@gmail.com Java 0 08-14-2006 03:12 AM
namespace prefixes in output xml Hubidubi XML 1 05-25-2006 02:39 PM
ElementTree Namespace Prefixes Chris Spencer Python 9 06-18-2005 06:48 AM
Xerces XS*, namespace prefixes and XSIDCDefinition string selector S ML XML 0 03-24-2005 04:28 AM



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