472,353 Members | 1,050 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

problem with prefixed elemets in the <SOAP-ENV:Body>, namespaces and not using the SOAPAction header

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> and
the request and responses are not suffixed with Request and Response.
Is there some more I could do with the attributes on the class that
defines the WS and on the methods. the code for the WS etc is below.

This I can get to work

POST /TestWS/TestOne.asmx HTTP/1.1
Content-Type: text/xml; charset=utf-8
SOAPAction: http://www.test.org/test/test
Content-Length: 184
Expect: 100-continue
Host: localhost

<Request xmlns="urn:test:test">

But I have 3 questions or issues.

1) Why is it the name of the parameter and not its type that is used
to map the element in the <SOAP-ENV:Body> on to the method in the c#
class and is it possible to change this?

2)Why does this:

POST /TestWS/TestOne.asmx HTTP/1.1
Content-Type: text/xml; charset=utf-8
SOAPAction: http://www.test.org/test/test
Content-Length: 199
Expect: 100-continue
Host: localhost

<SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'><SOAP-ENV:Body><tt:Request

raise and error and is it possible to get it working short of writing
my own HTTPHandler. And can I the web service to acknowledge to
namespaces used to prefix multiple elements?

3) How can I control the response so that it looks like this:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"

I need to be able to have multiple prefixes in the response. Is this

Any help would be greatly appreciated. I don't want to give up on what
is provided in .Net in terms of WS support and start writing this
stuff using an HTTPHandler. I have included the code that defines the
WS below:

[WebService(Name="RoutingStyleService", Namespace="urn:test:test")]
[SoapDocumentService(Use=SoapBindingUse.Literal,Par ameterStyle=SoapParameterStyle.Bare,RoutingStyle=S oapServiceRoutingStyle.RequestElement)]
public class TestOne : System.Web.Services.WebService
public TestOne()
protected override void Dispose( bool disposing )
if(disposing && components != null)

[ WebMethod ]
[ return: XmlElement("Response",IsNullable=false)]
public ResponseClass GetRequest(RequestClass Request)
ResponseClass t1 = new ResponseClass();
t1.ID= Request.ID;
return t1;

And two classes that define the types used in messages.

public class ResponseClass
public string ID;

public class RequestClass
public string ID;

public RequestClass()
Nov 21 '05 #1
0 2185

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

Similar topics

by: Clara Yeung | last post by:
I have captured some SOAP messages (using org.wsi.test.monitor.Monitor of the WSI test tool). When I try to analyze the messages with WSI test...
by: Earl Damron | last post by:
Hello All. Is it possible to create a Web service with C# that returns a response with two different elements in the SOAP Body? I'm thinking of...
by: Bryan Dickerson | last post by:
Ok, simple question: from a VB.Net web service (as I've said before, I'm a newbie to SOAP), how would I get the SOAP body into a string? My boss...
by: J. Dudgeon | last post by:
Is it possible to configure a .NET 2.0 ASMX Web service to accept namespace qualified messages? For instance, instead of: <soap:Envelope...
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS...

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.