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

<SOAP-ENV:Envelope
xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'>
<SOAP-ENV:Body>
<Request xmlns="urn:test:test">
<ID>32432</ID>
</Request>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

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
xmlns:tt="urn:test:test"><tt:ID>32432</tt:ID></tt:Request></SOAP-ENV:Body></SOAP-ENV:Envelope>

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/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<rr:Response
xmlns:rr="urn:test:test:response"><rr:ID>32432</rr:ID></rr:Response></soap:Body></soap:Envelope>

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

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()
{
InitializeComponent();
}
protected override void Dispose( bool disposing )
{
if(disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing);
}

[ WebMethod ]
[SoapDocumentMethod(Action="")]
[ 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
{
[XmlElement(ElementName="ID")]
public string ID;
}

public class RequestClass
{
[XmlElement(ElementName="ID")]
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

1
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...
5
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...
31
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...
6
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...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
2
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...
0
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...
0
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...
0
hi
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...
0
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...
0
Oralloy
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...
0
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....
0
BLUEPANDA
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.