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

How does SOAP work with ASP / webservices?

I have a question regarding SOAP.

A basic "Hello World" web service was written then requested from an IIS
server via TELNET. When a malformed request was sent, a SOAP exception was
returned, just as I would expect:

What was sent:
POST /helloworld/helloworld.asmx?op=HelloWorld HTTP/1.0

What was received:
HTTP/1.1 500 Internal Server Error.
Server: Microsoft-IIS/5.0
Date: Wed, 25 Feb 2004 19:38:32 GMT
X-Powered-By: ASP.NET
X-AspNet-Version: 1.1.4322
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Content-Length: 848

<?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>
<soap:Fault>
<faultcode>soap:Client</faultcode>
<faultstring>System.Web.Services.Protocols.SoapExc eption: Unable to
handle request without a valid action parameter. Please supply a valid soap
action.
at
System.Web.Services.Protocols.Soap11ServerProtocol Helper.RouteRequest()
at System.Web.Services.Protocols.SoapServerProtocol.I nitialize()
at System.Web.Services.Protocols.ServerProtocolFactor y.Create(Type type,
HttpContext context, HttpRequest request, HttpResponse response,
Boolean&amp; abortProcessing)</faultstring>
<detail />
</soap:Fault>
</soap:Body>
</soap:Envelope>

--EOF--

However, when a good request was made, what appears to be XML outside of the
SOAP definition was returned:

What was sent:
POST /helloworld/helloworld.asmx/HelloWorld HTTP/1.0

What was received:
HTTP/1.1 200 OK
Server: Microsoft-IIS/5.0
Date: Wed, 25 Feb 2004 21:00:47 GMT
X-Powered-By: ASP.NET
X-AspNet-Version: 1.1.4322
Cache-Control: private, max-age=0
Content-Type: text/xml; charset=utf-8
Content-Length: 116

<?xml version="1.0" encoding="utf-8"?>
<string xmlns="http://tempuri.org/">Hello World : NO REFERRER FOUND</string>

--EOF--

Am I missing something? It appears that a soap exception is returned on bad
requests, that a soap header could be created for specific purposes, but by
default .NET will not return soap encapsulated responses. I know that SOAP
by definition cannot contain a DTD. Is the XML encoded response then an
assumed SOAP header?

Thanks,
Bri Gipson
mo********@nospig.irb

Nov 18 '05 #1
1 2230
..NET supports different message formatting protocols, one of which (the
preferred one) is SOAP. But you can also use HTTP-POST and HTTP-GET as
message format protocols. If you visit the .asmx page through your
browser - http://localhost/myWebService.asmx - and click on a method name
from the list, you'll see the request/response formats for the different
message formats.

By not passing in a SOAP request, your Web service thinks you are invoking
it using the HTTP-POST message format, so it sends its reponse back in
that format. (That's why you're not getting a SOAP response.) In .NET
1.1, HTTP-POST is disabled by default, except for when you are visiting
through localhost. You can configure what message format protocols are
supported through your Web.config or machine.config files...

hth

--

Scott Mitchell
mi******@4guysfromrolla.com
http://www.4GuysFromRolla.com
http://www.ASPFAQs.com
http://www.ASPMessageboard.com

* When you think ASP, think 4GuysFromRolla.com!

"Dr. Frankenchurn" <sp******@not.welcome.com> wrote in message
news:ct****************@newsread1.news.pas.earthli nk.net...
I have a question regarding SOAP.

A basic "Hello World" web service was written then requested from an IIS
server via TELNET. When a malformed request was sent, a SOAP exception was returned, just as I would expect:

What was sent:
POST /helloworld/helloworld.asmx?op=HelloWorld HTTP/1.0

What was received:
HTTP/1.1 500 Internal Server Error.
Server: Microsoft-IIS/5.0
Date: Wed, 25 Feb 2004 19:38:32 GMT
X-Powered-By: ASP.NET
X-AspNet-Version: 1.1.4322
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Content-Length: 848

<?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>
<soap:Fault>
<faultcode>soap:Client</faultcode>
<faultstring>System.Web.Services.Protocols.SoapExc eption: Unable to handle request without a valid action parameter. Please supply a valid soap action.
at
System.Web.Services.Protocols.Soap11ServerProtocol Helper.RouteRequest()
at System.Web.Services.Protocols.SoapServerProtocol.I nitialize()
at System.Web.Services.Protocols.ServerProtocolFactor y.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response,
Boolean&amp; abortProcessing)</faultstring>
<detail />
</soap:Fault>
</soap:Body>
</soap:Envelope>

--EOF--

However, when a good request was made, what appears to be XML outside of the SOAP definition was returned:

What was sent:
POST /helloworld/helloworld.asmx/HelloWorld HTTP/1.0

What was received:
HTTP/1.1 200 OK
Server: Microsoft-IIS/5.0
Date: Wed, 25 Feb 2004 21:00:47 GMT
X-Powered-By: ASP.NET
X-AspNet-Version: 1.1.4322
Cache-Control: private, max-age=0
Content-Type: text/xml; charset=utf-8
Content-Length: 116

<?xml version="1.0" encoding="utf-8"?>
<string xmlns="http://tempuri.org/">Hello World : NO REFERRER FOUND</string>
--EOF--

Am I missing something? It appears that a soap exception is returned on bad requests, that a soap header could be created for specific purposes, but by default .NET will not return soap encapsulated responses. I know that SOAP by definition cannot contain a DTD. Is the XML encoded response then an
assumed SOAP header?

Thanks,
Bri Gipson
mo********@nospig.irb

Nov 18 '05 #2

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...
2
by: deba | last post by:
From the documentation of SOAP it seems SOAP supports both HTTP and TCP protocol.I did not find much documentation how to use TCP as transport layer in SOAP? Does the SOAP toolkit 2.0 supports...
4
by: pepcag | last post by:
I used http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconalteringsoapmessageusingsoapextensions.asp as a template to create a very simple web method with soap...
4
by: Henrik | last post by:
Hi all,, I'm trying to make a program, that calls a webservice, and then does somthing about the data, that i recive.. But i don't know what to do with this data??.. i tried to load into an...
0
by: Peter Theill | last post by:
I have these two web services: namespace WebService1 { public class Service1 : System.Web.Services.WebService { public Service1() { } public string HelloWorld() {
7
by: Nalaka | last post by:
Hi, I created a sinple web service that returns a dataSet. Then I created a client program that uses this web service (that returns the Dataset). My question is, how did the client figure...
6
by: A.M-SG | last post by:
Hi, We are developing a SmartClient application and we are planning to expose business objects layer to SmartClient application by using ASP.NET SOAP web services.
5
by: A.M-SG | last post by:
Hi, I am developing a SOAP extender and I need to store some session information at BeforeSerialize ProcessMessage event, so at the AfterDeserialize ProcessMessage event I know which call I...
3
by: Sydney | last post by:
Hi, I am trying to construct a WSE 2.0 security SOAP request in VBScript on an HTML page to send off to a webservice. I think I've almost got it but I'm having an issue generating the nonce...
0
by: Wijnand Kroes | last post by:
Hi guys, I have a C#.NET client which sends SOAP requests to .Net webservices and non ..Net webservices. If I do not add a SOAP header a get a valid response from all webservices. If I do add...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
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...

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.