cancel
Showing results for 
Search instead for 
Did you mean: 

how to pass header field in soap channel

maheswarareddykonda
Active Contributor
0 Kudos

Hi Experts,

I am working Proxy to soap synchronous interface and I suppose to send data like below.

Here problem is Header and body both structure are not able to select at a time from external definition which I imported for soap structure. To achieve I suppose to do either create custom structure with header and body with envelope or add that header filed in communication channel to pass in request.

But I don’t want to create custom structure, so please suggest be how to add that field in channel level?

And which adapter message protocol is better (soap or axis)?

Is there any other possibilities to achieve easy?

Please note even I cannot change prefixes such as <soapenv:Header> <edoc:ApiAccessToken>

Thanks & Regards,

Maheswarareddy

Accepted Solutions (1)

Accepted Solutions (1)

former_member186851
Active Contributor
0 Kudos

Hello Mahesh

Select External definition for Body

And for Header ,3 options are available

1.using XSLT Mapping

2.using Java Mapping

3.Using Module Beans.

maheswarareddykonda
Active Contributor
0 Kudos

Hi Raghu,

thanks for reply..

i had done as per that blog pls see below config screenshot.

and facing below error.

as per that error i understood accesstoken not taking from channel which i maintained using module..

please suggest.

BR,

Maheswarareddy

former_member186851
Active Contributor
0 Kudos

Hello Mahesh,

Is this Token Valid?

maheswarareddykonda
Active Contributor
0 Kudos

Yes Raghu,

its valid and tested in SOAP UI tool.

former_member186851
Active Contributor
0 Kudos

Try this Mahesh,

1   ApiAccessToken   <edoc:value>your token</edoc:value>

1   namespace            your corresponding namespace for edoc

former_member186851
Active Contributor
0 Kudos

And dont forget to select " dont use soap envelope"option in the channel

maheswarareddykonda
Active Contributor
0 Kudos

Hi Raghu,

i added as per your suggested and now below is the error,

Transmitting the message using connection AFW failed, due to: com.sap.engine.interfaces.messaging.api.exception.MessagingException: java.io.IOException: Parsing Error: org.xml.sax.SAXParseException: The prefix "edoc" for element "edoc:Value" is not bound.


i added the corresponding namespace, but still throwing exception on same


as per that blog i dont think we suppose to give namespace for prefix..that name space is mandatory which we need to give namespace actual one not prefix think.


please suggest me how declare the prifix namespace.


asdasd_asdasd
Active Participant
0 Kudos

Please check the namespace defined for "edoc"(apparently is not "http://schemas.xmlsoap.org/soap/envelope"), can  you share the wsdl?.

former_member184720
Active Contributor
0 Kudos

I don't think prefix must only be "edoc" in the xml.

Can you try below configuration

ApiAccessToken -> <ns0:Value>pvb</ns0:Value>

namespace -> "yournamespace" for edoc //same as what you are testing from soap UI.

Just FYI-

from soap UI request message, just do a replace all on "edoc" to "ns0", i believe this would work.

if itis working then changing the configuration to above would be successfull too.

maheswarareddykonda
Active Contributor
0 Kudos

Hi Hareesh,

even with ns0 is working. below is the wsdl file which works fine in SOAP UI tool

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns0="edoc">

   <soapenv:Header>

      <ns0:ApiAccessToken>

         <ns0:Value>value</ns0:Value>

      </ns0:ApiAccessToken>

   </soapenv:Header>

   <soapenv:Body>

      <ns0:RequestOf_BusinessSearchCriteria>

         <!--Optional:-->

         <ns0:Input>

            <!--Optional:-->

            <ns0:PageIndex>10</ns0:PageIndex>

            <!--Optional:-->

            <ns0:ResultsPerPage>10</ns0:ResultsPerPage>

            <!--Optional:-->

            <ns0:Keyword>ABC</ns0:Keyword>

         </ns0:Input>

      </ns0:RequestOf_BusinessSearchCriteria>

   </soapenv:Body>

</soapenv:Envelope>

but i am trying to send data like this

<?xml version="1.0" encoding="UTF-8"?>

<ns0:RequestOf_BusinessSearchCriteria xmlns:ns0="edoc">

   <ns0:Input>

      <ns0:PageIndex>10</ns0:PageIndex>

      <ns0:ResultsPerPage>10</ns0:ResultsPerPage>

      <ns0:Keyword>ABC</ns0:Keyword>

   </ns0:Input>

</ns0:RequestOf_BusinessSearchCriteria>

and added parameters as per this bolg

BFB channel

pls suggest me where iam doing wrong.

now error is badrequest

maheswarareddykonda
Active Contributor
0 Kudos

HI maximiliano,

posted above pls check and suggest me where i am wrong

former_member184720
Active Contributor
0 Kudos

Remove the namespace entry from the module and try. You have this information in the request message.

asdasd_asdasd
Active Participant
0 Kudos

Please share the wsdl

maheswarareddykonda
Active Contributor
0 Kudos

Hi Hareesh,

i have removed namespace, then it throwing exception as Transmitting the message using connection AFW failed, due to: com.sap.engine.interfaces.messaging.api.exception.MessagingException: java.lang.Exception: Bubble configuration error: parameter 'namespace' is missing.

which mean namespace is mandatory.

when i keep namespace,  error is 400 Bad request..also i believe since error is Bad request that header info reaching and validaing is fine and i am missing something config here..Please suggest me.

Also i configure Advanced seetings(kept all logs) in ICO to get log but i did not see any diffence in data than i sent ,can i see what data goes after this module?

Note: I tried with prefixes ns0: and edoc: as hardcoded in Value.

maheswarareddykonda
Active Contributor
0 Kudos

hi Max,    I had shared wsdl file above by this time Aug 19, 2015 4:13 PM while replying Hareesh.


Pls check

former_member184720
Active Contributor
0 Kudos

Check with your webservice provider, they should be able to analyze the request message that you are sending in their logs.

Else, you can make use of XPI inspector to see how your request message is being sent (along with soap header).

maheswarareddykonda
Active Contributor
0 Kudos

Hi Hareesh,

Issue got resolved

i had to uncheck the Do not use soap evelope in channel

Thanks all for put me on right direction.

Answers (1)

Answers (1)

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Mahesh,

Use XSLT mapping and select it in the operational mapping after the message mapping level. Make sure you select Do not use soap envelope option in the soap channel since you have manually maintained at the mapping level.

Refer below thread which discussed the same issue.

How to add a soap header in the mesage | SCN

Let me know if you still having any issues.

maheswarareddykonda
Active Contributor
0 Kudos

Hi Vishnu,

thanks for reply ..

yes..that apprch defently will work and also had done the POC, but i want handle in channel itself because to avaoid multiple mappings,

please suggest is there any possiblities channel.

BR,

Maheswarareddy

former_member186851
Active Contributor
0 Kudos

Mahesh I would suggest to go with Beans Since your Token might vary in future,

Everytime its not recommeded to disturb the mapping program.

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Mahesh,

If that's the case, then use the module bean as suggested by raghuram.

In the blog, use the case 2 one, which might solve your requirement.

maheswarareddykonda
Active Contributor
0 Kudos

Raghuram,

that token is static , it wont change evry time

pvishnuvardan_reddy
Active Contributor
0 Kudos

HI Mahesh,

Does the issue has resolved?

If not, can you try with the below module parameters

namespace      edoc GIVE As per your requirement

ApiAccessToken <edoc:Value>VALUE</edoc:Value>

maheswarareddykonda
Active Contributor
0 Kudos

Hi Vishnu,

i tried that , its still saying Prefix not declared.

SOAP: Error occurred: com.sap.engine.interfaces.messaging.api.exception.MessagingException: java.io.IOException: Parsing Error: org.xml.sax.SAXParseException: The prefix "edoc" for element "edoc:Value" is not bound.