• Post Reply Bookmark Topic Watch Topic
  • New Topic

Is there a way I can view the raw (HTTP) web service response?

 
Mark E Hansen
Ranch Hand
Posts: 650
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have create a web service using Eclipse and JBossTools, following the examples in the book: EJB3 in Action. I am deploying the application to JBoss AS 5.1.0.GA.

The web service deploys and I'm able to invoke the method using a web-based test client, like: http://www.soapclient.com/soaptest.html, and I get back what looks like a valid response.

However, my partner is trying to call the service method from a .NET client, and is getting the error:

According to my searches, this can be caused by a mal-formed response header.

I would like to snoop the response sent by the service, but can't find any way to do this.

I know the service address, and thanks to the above test web site, I can get the request XML content. Is it possible to call the service via telnet so I can see exactly what is returned, including HTTP response headers?

Thanks,
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are two well known tools for capturing the full text of request and response.

TCPMON - provided with Axis and also downloadable separately and SoapUI a free well developed toolkit.

As you suspect, being able to see the full text is key to debugging web services.

Bill
 
Mark E Hansen
Ranch Hand
Posts: 650
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you, William. I downloaded soapUI and it was pretty easy to get up and running.

I placed a call to my web service method, and inspected the raw HTTP response which I received, and it looks okay to me:


Is there something wrong with the response such that the .NET clients get the before mentioned error?

According to my research into that error, the common reason is that the Content-Length header has a space in it. But the response I get from my web service doesn't even have a Content-Length header. Even so, none of the other response header names have any spaces in them.

Is there something else wrong with my service method's response?

Thanks,

 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My next step would be to capture the request text as generated by the .NET client.

It is not clear that the server error was created on interpretation of the request or on generation of the response.

Bill
 
Mark E Hansen
Ranch Hand
Posts: 650
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I talked to my partner last night, and he said that after further debugging, he thinks the problem was due to the way he was setting up the call in the .NET client application. He said something about having to do some extra steps, although I don't know what those would be, as my web service seems typical of the architecture.

In any case, once he worked those issues out, he was able to successfully invoke the web service method and get a proper response.

Thanks to all for the terrific help. I love JavaRanch
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!