• 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

SOAP header in SOAP request

 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Saloon Keeper
Posts: 7627
177
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is the sample request.

Header.jpg
[Thumbnail for Header.jpg]
 
Tim Moores
Saloon Keeper
Posts: 7627
177
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I do not want to add it programmatically at run time.

I want to add it along with the existing SOAP header.
 
Tim Moores
Saloon Keeper
Posts: 7627
177
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Saloon Keeper
Posts: 7627
177
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Saloon Keeper
Posts: 7627
177
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Saloon Keeper
Posts: 7627
177
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?

 
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
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
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Saloon Keeper
Posts: 7627
177
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Quick! Before anybody notices! Cover it up with this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic