INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

How to send a SOAP Request

How to send a SOAP Request

(OP)
How do i send a Soap request like the below in Java.
Links to SOAP for newbies will be much appreciated as well.

Regards
POST /Quotation HTTP/1.0
Host: www.xyz.org
Content-Type: text/xml; charset=utf-8
Content-Length: nnn

<?xml version="1.0"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://www.w3.org/2001/12/soap-envelope"
SOAP-ENV:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
  <SOAP-ENV:Body xmlns:m="http://www.xyz.org/quotations">
    <m:GetQuotation>
      <m:QuotationsName>MiscroSoft</m:QuotationsName>
    </m:GetQuotation>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
 

RE: How to send a SOAP Request

(OP)
Thanks TonHu, but say i already have a wsdl file with the schema, to create the xml file, do i still need that.

RE: How to send a SOAP Request

(OP)
Hi TonHu,Thansk for your help,  which file am i suppose to download. do i have to install the whole Axis server or there are jar file, i just have to import and then use.

RE: How to send a SOAP Request

(OP)
Hi Thanks DianCecht,
Do i need to install Apache first or i just have to import the jar files. i was wondering where the URL for sending will come from. i have seen the following example:
http://cxf.apache.org/docs/a-simple-jax-ws-service.html

RE: How to send a SOAP Request

That link is to build a service, not to invoke a service. Take a look at this

Cheers,
Dian

RE: How to send a SOAP Request

Cfx is as good, or possibly better than Axis2.

Just don't try to mock up your own xml to send to 'the other side', that's just a waste of time to say the least, en very error-prone as well.

RE: How to send a SOAP Request

(OP)
Thank guys for your help, im getting this error message when i try to read from wsdl file:
Exception in thread "main" javax.xml.ws.WebServiceException: {http://server.hw.demo/}HelloWorld is not a valid service. Valid services are: {http://apache.org/hello_world_soap_http}SOAPService

My implimentation is like this:
 private static final QName SERVICE_NAME
     //   = new QName("http://server.hw.demo/", "HelloWorld");
     = new QName("http://apache.org/hello_world_soap_http", "S0APService");
    private static final QName PORT_NAME
     = new QName("http://apache.org/hello_world_soap_http", "HelloWorldPort");

RE: How to send a SOAP Request

(OP)
i have fixed the above problem, but am now getting Undefined Port Type: http://mesh/}HelloWorld.
Do i have to create a port somewhere outside the code.

Regards

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close