• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

SOAP over TCP

 
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)?
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic