FAQ
Hi,

I'm experimenting using camel to call a soap service but failing to
find the magic combination of steps to get the soap action header set.

The current approach I'm taking is to do something like the following:

public void configure() {
   SoapJaxbDataFormat soapDF =
             new SoapJaxbDataFormat(MyJaxBRequest.class.getPackage().getName());

   from("direct:callSoap")
   .beanRef("myJaxBRequestBuilder")
   .setHeader("SOAPAction", simple("\"http://schemas.example.com""))
   .marshal(soapDF)
   .to("stream:out");
}

Where myJaxBRequestBuilder is a bean that has a trivial signature:

public class MyJaxBRequestBuilder {
   public MyJaxBRequest newRequest() {
     MyJaxBRequest req = new MyJaxBRequest();
     // hard code various request params for now...
     return req;
   }
}

This generates a soap request of the form:

<ns2:Envelope xmlns:ns2="http://schemas.xmlsoap.org/soap/envelope/">
     <ns2:Body>
       ...
     </ns2:Body>
</ns2:Envelope>

But there are no headers set...

Is what I'm trying to do supported? Am I missing some configuration in
the routerbuilder?

Many thanks for any help.

Regards,

/Dave

Search Discussions

  • Willem Jiang at Apr 26, 2012 at 2:12 am
    The soap action header is part of HTTP header not a part of soap
    envelop.
    And there are quit difference between the SOAP 1.1 and SOAP 1.2.

    On Wed Apr 25 23:03:29 2012, David Savage wrote:
    Hi,

    I'm experimenting using camel to call a soap service but failing to
    find the magic combination of steps to get the soap action header set.

    The current approach I'm taking is to do something like the following:

    public void configure() {
    SoapJaxbDataFormat soapDF =
    new SoapJaxbDataFormat(MyJaxBRequest.class.getPackage().getName());

    from("direct:callSoap")
    .beanRef("myJaxBRequestBuilder")
    .setHeader("SOAPAction", simple("\"http://schemas.example.com""))
    .marshal(soapDF)
    .to("stream:out");
    }

    Where myJaxBRequestBuilder is a bean that has a trivial signature:

    public class MyJaxBRequestBuilder {
    public MyJaxBRequest newRequest() {
    MyJaxBRequest req = new MyJaxBRequest();
    // hard code various request params for now...
    return req;
    }
    }

    This generates a soap request of the form:

    <ns2:Envelope xmlns:ns2="http://schemas.xmlsoap.org/soap/envelope/">
    <ns2:Body>
    ...
    </ns2:Body>
    </ns2:Envelope>

    But there are no headers set...

    Is what I'm trying to do supported? Am I missing some configuration in
    the routerbuilder?

    Many thanks for any help.

    Regards,

    /Dave


    --
    Willem
    ----------------------------------
    CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
    FuseSource
    Web: http://www.fusesource.com
    Blog: http://willemjiang.blogspot.com (English)
              http://jnn.javaeye.com (Chinese)
    Twitter: willemjiang
    Weibo: willemjiang
  • Gangaaloori at Jan 16, 2014 at 6:58 am
    Hi Willem,

    I understand that soap headers and http headers are different but my
    question is, is it possible to set soap header values using
    soapjaxbdataformat?

    Thanks,
    Ganga



    -----
    Thanks,
    Ganga Aloori
    --
    View this message in context: http://camel.465427.n5.nabble.com/Setting-a-soap-action-on-SoapJaxbDataFormat-tp5665112p5746017.html
    Sent from the Camel - Users mailing list archive at Nabble.com.
  • Willem Jiang at Jan 16, 2014 at 7:27 am
    The soap header value is taken from the message object, I don’t think you can set the soap header from the message header directly.

    --
    Willem Jiang

    Red Hat, Inc.
    Web: http://www.redhat.com
    Blog: http://willemjiang.blogspot.com(http://willemjiang.blogspot.com/) (English)
    http://jnn.iteye.com(http://jnn.javaeye.com/) (Chinese)
    Twitter: willemjiang
    Weibo: 姜宁willem


    On January 16, 2014 at 2:58:36 PM, gangaaloori (ganga.aloori@gmail.com) wrote:

    Hi Willem,

    I understand that soap headers and http headers are different
    but my
    question is, is it possible to set soap header values using
    soapjaxbdataformat?

    Thanks,
    Ganga



    -----
    Thanks,
    Ganga Aloori
    --
    View this message in context: http://camel.465427.n5.nabble.com/Setting-a-soap-action-on-SoapJaxbDataFormat-tp5665112p5746017.html
    Sent from the Camel - Users mailing list archive at Nabble.com.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupusers @
categoriescamel
postedApr 25, '12 at 3:03p
activeJan 16, '14 at 7:27a
posts4
users3
websitecamel.apache.org

People

Translate

site design / logo © 2022 Grokbase