aspose file tools*
The moose likes Web Services and the fly likes SOAP header in SOAP request Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "SOAP header in SOAP request" Watch "SOAP header in SOAP request" New topic
Author

SOAP header in SOAP request

Rajesh Balu
Ranch Hand

Joined: Nov 07, 2011
Posts: 55
Hi,


How to add the soap header in the SOAP request?

I want to add the headers not through coding. I want to add it manually.

I can able to add the headers through SOAPUI. But i need to add in request.
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
I don't understand what you're trying to do. SOAP is something that is generally created dynamically at runtime via a library, not manually or statically. What do you hope to achieve by creating SOAP statically? Can you post an example of the SOAP you have, the SOAP you'd like to have, and explain the use case?
Rajesh Balu
Ranch Hand

Joined: Nov 07, 2011
Posts: 55
Here is the sample request.



[Thumbnail for Header.jpg]

Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
So you do not actually want to add that header manually, you want to add it programmatically at runtime? How are you creating the SOAP call, meaning - which API are you using?
Rajesh Balu
Ranch Hand

Joined: Nov 07, 2011
Posts: 55
I do not want to add it programmatically at run time.

I want to add it along with the existing SOAP header.
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Sorry, I don't get it. You don't want to add it manually, and you don't want to add it programmatically. When, and how, do you want to add it? It seems that your problem is rather unusual, so you need to tell us more about it.
Rajesh Balu
Ranch Hand

Joined: Nov 07, 2011
Posts: 55
Here is my scenario.

I have an XML which is generated from an application.

I need to transform it to SOAP request through transformation.

I have created a transformation by adding the SOAP tags as text.

Now i am experiencing the SOAP header issue which i need to add along with the request.

I cannot use any coding stuff here.

Hpoe this is much clear now. Please let me know if you need more details.
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Sorry, it's not any clearer. You're asking about an XML/SOAP file that you have locally on your machine? What, exactly, do you mean by "transformation"? If you can add SOAP tags, why can't you add SOAP headers?
Rajesh Balu
Ranch Hand

Joined: Nov 07, 2011
Posts: 55

Transformation is a processing of converting XML to SOAP request. I am not familiar about the SOAP header format.

Please let me know the header format, so that i can add it in the transformation.
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
SOAP is a very simple format; I suggest you read its specification, then it should become clear. I also don't want to send you down some wrong avenue, as I don't understand what you're trying to do, and why.
Rajesh Balu
Ranch Hand

Joined: Nov 07, 2011
Posts: 55
Hi,


Still i am not getting any clear idea. Could someone please help me to add additional HTTP headers to SOAP message?


Thanks,
Rajesh.B
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
I don't think anyone will be able to help you unless and until you answer these questions:
Tim Moores wrote:Sorry, it's not any clearer. You're asking about an XML/SOAP file that you have locally on your machine? What, exactly, do you mean by "transformation"? If you can add SOAP tags, why can't you add SOAP headers?
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
Are you using an existing SOAP toolkit such as AXIS2 or are you using standard Java to manage sending the request?

In one place you say SOAP header and in another HTTP headers - not the same. SOAP headers are part of the HTTP request body sent to the SOAP server. Which is it?

Bill
Rajesh Balu
Ranch Hand

Joined: Nov 07, 2011
Posts: 55

I am using SoapUI to sending the request. I don't want to use any java code here.

Sorry, It's Soap additional HTTP header. I need to add it along with the SOAP request.
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Rajesh Balu wrote:It's Soap additional HTTP header.

As was mentioned before, SOAP headers are not HTTP headers. So which one is it?
Rajesh Balu
Ranch Hand

Joined: Nov 07, 2011
Posts: 55

For an example: i would like to add HTTP header like Content-Type HTTP header in SOAP request.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
Well, if SOAPui doesn't provide for that you will need to write your own code to send the request, right?

It is pretty straightforward, the java standard library has all you need to make a HTTPUrlConnection and send a request with the body being your SOAP message.

Bill
Rajesh Balu
Ranch Hand

Joined: Nov 07, 2011
Posts: 55

Actually i am in a scenario of not using any coding stuffs. So i need to add it without any coding stuffs.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
According to this SOAPui documentation it is possible to create custom HTTP headers.

I found that in about 2 seconds googling for "soapui http header"

Why are you bothering us when SOAPui has a documented way to do what you want? RTFM
Rajesh Balu
Ranch Hand

Joined: Nov 07, 2011
Posts: 55
Hi,


Thanks for all your prompt response.

yes there is an option to add the custom HTTP headers in SoapUI. But i need to add the same in the request itself instead of adding it through some options.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SOAP header in SOAP request