• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SOAP over TCP

 
swapnil paranjape
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)?
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13074
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


this is the request i am sending. IS there anything wrong with this(syntactically?)
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13074
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic