Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

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

 
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,
 
Author and all-around good cowpoke
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
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
 
"How many licks ..." - I think all of this dog's research starts with these words. Tasty tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic