Re: IIS returns status code 200 even if XML is invalid



Mr. Arnold,

this is not completely true. ASMX requests are handled by ASP.NET
infrastructure. And ASP.NET infrastructure unwraps (processes) the
SOAP message and invokes the method on an object to handle such
requests. This object is defined in an ASMX file, and the class behind
this ASMX file handles the call.

Normally, when there is a problem with an XML being sent to the server
(ordinary web service application), ASP.NET will complain with either
400 Bad request or 500 internal server error (depending which
extensions (WSE3.0) you use).

But in this, we're getting this weird behaviour, that ASP.NET returns
success status code back to the client, even when:
* XML is badly formatted (i.e. not well formed)
* XML does not adhere to schema/DTD

The request is not being handled by the "designated method" which
should handle the request.

To illustrate:

our scenario:
client ---- malformed XML ---> IIS(asmx) --> return code 200

new ASP.NET asmx webservice project:
client ---- malformed XML --> IIS(asmx) --> return code 400 (bad
request)

When debugging our application, I can see in the debugger that there
is exception thrown (three of them actually), but it does not affect
the status code.

Also note, that there is no XML returned from the server. Just HTTP
status code 200 and then connection terminates. It is a really weird
behaviour...

Hope that helps to clarify the problem we're seeing...

Thanks,
Miha

On Aug 5, 9:48 am, "Mr. Arnold" <MR. Arn...@xxxxxxxxxx> wrote:
"Miha V" <miha.valen...@xxxxxxxxx> wrote in message
That HTTP 1.1 200 OK return code means the the HTTP request/connection
between the Web client and the Web  server  was OK. It is not an indication
of data exchanged between the Web client and Web service  is invalid or
valid in the case the XML that has been transmitted between the Web client
and Web server.

The only thing you should be concerned about is that the 200 OK was
returned, and if it's not a 200 OK return code, then take the appropriate
action to indicate that there is something wrong with the HTTP connection
between the Web client and Web server, and the connection cannot be made
established between the two.

The return code can be 200 OK and no data was transmitted period, but most
likely, you'll get some kind  formatted XML return code from the Web service
to the Web client indicating the Web service had a problem in processing
data.

So it doesn't matter if the XML is valid,  not valid or no XML is returned
period when HTTP 1.1 200 OK is returned.

It's up to you check for return codes and take the appropriate action, and
it's up to you to check if the XML is valid by validating the XML data
against a XML schema and taking the appropriate action if it's valid or not
valid. HTTP 1.1 200 OK has nothing to do with valid or invalid XML being
transmitted.

.



Relevant Pages

  • Re: How to architect BizTalk calling a web service
    ... Looks like what you have is not a SOAP web-service, but simply an HTTP endpoint dealing with POX (plain old xml). ... From what you describe, you should be able to call it by first manually adding the schemas you have to your biztalk project and using those to deal with the request and response messages, and then using the HTTP send adapter to invoke the service. ... The reason I want to use BizTalk is to be able to transform/process the data I receive from the service before storing it in a SQL db. ...
    (microsoft.public.biztalk.general)
  • RE: application communication in xml without webservices?
    ... could POST an XML document to a URL over HTTP. ... It could then repeat this process, making plain old HTTP requests ... In your request you asked whether sending your XML in SOAP will help - it ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • Re: XMLRPC Question
    ... code is trying to match the xml definition line to an HTTP response ... The server is returning the plain ... The HEAD request would return ...
    (comp.lang.ruby)
  • Re: XMLRPC Question
    ... and not a HTTP request. ... XML-RPC is usually served via HTTP. ... are you sure that the XML shown above is valid XML-RPC? ...
    (comp.lang.ruby)
  • Re: IIS returns status code 200 even if XML is invalid
    ... I certainly agree that the problem is on the client side. ... Client MUST not send malformed XML. ... ASMX requests are handled by ASP.NET ... The request is not being handled by the "designated method" which ...
    (microsoft.public.dotnet.framework.webservices)

Quantcast