wood burning stoves 2.0*
The moose likes Web Services and the fly likes SOAP over TCP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "SOAP over TCP" Watch "SOAP over TCP" New topic
Author

SOAP over TCP

swapnil paranjape
Ranch Hand

Joined: May 15, 2005
Posts: 126
Hi Friends,

I have written a program to send a xml request and receive a response.



But in this case it is making a connection using http. i want to make connection using tcp . What should be the change in the code?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41155
    
  45
Although there could in theory be a binding of SOAP to TCP (just like there are bindings to SMTP or JMS), I'm not aware that one actually exists. The beauty (or danger, according to some people) of using HTTP is that it travels over port 80, which is open on most firewalls. That's not true for just any TCP port.

What are you trying to achieve by using plain TCP instead of HTTP (which also uses TCP, of course)?


Ping & DNS - my free Android networking tools app
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12761
    
    5
i want to make connection using tcp


How familiar with socket programming are you?

A SOAP message is just a stream of characters, it can be moved around by a variety of methods, but both ends of the communication have to agree on the method. What does the service you are contacting expect?

Bill
swapnil paranjape
Ranch Hand

Joined: May 15, 2005
Posts: 126
When i am using http , i am getting response with error code 401 authorisation required.

thats why i want to use tcp.

can you please let me know the workaround for this error?

actually i am expecting SOAP envelop like this:




but using below code



i am getting Envelope like this




is it causing the error?
[ March 16, 2007: Message edited by: swapnil paranjape ]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41155
    
  45
A 401 is an HTTP error condition, which means that the listening end is implemented in HTTP. You won't be able to access it using raw TCP.

Many WS can only be accessed by authorized users. The way to solve this is to become an authorized user, and then pass the username/password information along with the request. Some information about that can be found here.
swapnil paranjape
Ranch Hand

Joined: May 15, 2005
Posts: 126
hi ,

when i made an attempt to send username password for authorisation , i got the error 500 server internal error.


when i dont send username and password in the header i am getting error 401 authorisation required,


does above 2 errors are comming because of improper request?

i have


in my evvolpe , which is actually not required by is created by default because of


can you please suggest some workaround?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41155
    
  45
What does the SOAP look like that you are sending out? Have you looked at it using a tool like tcpmon to see whether it is correct when using authentication? Are you certain that the username/password combination you're using is valid? Since 500 is a server-side error, maybe the admins of the WS can look into their logs to see what went wrong.
swapnil paranjape
Ranch Hand

Joined: May 15, 2005
Posts: 126


this is the request i am sending. IS there anything wrong with this(syntactically?)
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12761
    
    5
Given that the 500 and 401 errors you are getting are basic server HTTP errors, it is not at all clear that your message is even getting through to the web service to be parsed so the content of the SOAP message may not matter.
I suspect your request is either not addressed correctly or contains some other error. TCPMON should capture your entire request with headers and the entire server response - perhaps the creator of the web service can look at all of that information and tell you what is wrong.

Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SOAP over TCP
 
Similar Threads
Webservice Help!
[SOAP-ENV:Envelope: null]
webservice using servlet
How to integrate SAAJ 1.3 and XMLBEANS 2.3
My First Soap Request , getting this Error "SEVERE: SAAJ0531: Unable to parse content type"