473,396 Members | 2,111 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,396 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 2272

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 tool analyzer, the "message" artifact of the report...
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 something like this: <?xml version="1.0"...
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 and I concur that it, at least from our...
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 xmlns:soap="http://www.w3.org/2003/05/soap-envelope"...
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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.