cancel
Showing results for 
Search instead for 
Did you mean: 

SOAP header information [continued]

Dimitri
Active Contributor
0 Kudos

Dear,

It all started here

The fact is that I get the WSDL delivered and I need to upload that into the ESR.

Next step is to create/generate a Service Interface.

What I see in the WSDL binding

After I generated a Service Interface

Where is my SOAP header part? It seems to be gone in the Service interface?

I tried this for both SOAP 1.1 and 1.2. Both the same phenomenon.

Any suggestions?

Thanks a lot

Kind regards, Dimitri

Accepted Solutions (1)

Accepted Solutions (1)

iaki_vila
Active Contributor
0 Kudos

HI Dimitri,

Why not to work without the header information in the sender/receiver schemas?

You can use the ASMA attributes to get the header information  Configuring the Sender SOAP Adapter (SAP Library - SAP NetWeaver Exchange Infrastructure) and later to transfer it to the receiver.

You could use a XSL/JavaMapping + Do Not use soap envelope in the sender/receiver SOAP adapter.

You could work with addSOAPHeaderBean as PRAVEEN GUJJETI explains in his blog

You could work with the SOAP AXIS adapter 1385579 - Axis adapter's generic Header insertion/extraction handlers (i havent tested this option).

Finally, if you want to try importing all the SOAP connection, you can try to reduce the WSDL, with no business information, and to share here (tell the PI version as well) in order to to the SCN members can try to import it in his systems.

Regards..

Dimitri
Active Contributor
0 Kudos

Hi,

Thank you for your valuable feedback!

I checked the AddSOAPHeaderBean and that seems to be useful. But...

In that case, the header will be added as part of the payload and we do not want to have a SOAP header part in the payload in the WSDL.

So, the consuming part just need to add a SOAP header dynamically and provide the data in the WSDL. That combination will be handled by SAP PI.

Some header fields will be mapped to target fields, which go to an ABAP proxy.

I hope the requirement above is clear.

Kind regards,

Dimitri

former_member181985
Active Contributor
0 Kudos

Hi Dimitri,


I checked the AddSOAPHeaderBean and that seems to be useful. But...

In that case, the header will be added as part of the payload and we do not want to have a SOAP header part in the payload in the WSDL.

Just to clarify: the stanadard AddSOAPHeaderBean module adds the required custom header in SOAP header section only (not in SOAP payload)

As far as I understood, your scenario is from SOAP -> XI --> ABAP proxy and you are trying to read a  custom header from SOAP (Sender) some how in XI may be using some custom code mapping or module and then use  the fetched header info for target. Right?

Regards,

Praveen Gujjeti

Dimitri
Active Contributor
0 Kudos

Hi Praveen,

That is correct.

We do not want to put header fields into the payload and hand that over to the web service consuming party.

SAP PI should read the header and map the fields to the target structure (used in the ABAP proxy).

Is that feasible using the AddSOAPHeaderBean?

Kind regards,

Dimitri

former_member181985
Active Contributor
0 Kudos

Hi Dimitri,

As I mentioned earlier AddSOAPHeaderBean is capable of only adding custom header tags but not to read custom or standard headers from XI message.

In my opinion, reading custom headers should be possible with some custom coding may be with a module if you can drill down into module API's to understand XI message protocol further

Regards,

Praveen Gujjeti

Dimitri
Active Contributor
0 Kudos

Hi Praveen,

What I do now is reading the Dynamic Configuration part, but that's not the preferred way to do it.

Kind regards,
Dimitri

Dimitri
Active Contributor
0 Kudos

Hi Praveen,

I'm testing now with the option Do not use SOAP envelope in the sender SOAP adapter and now, I see the actual SOAP header in the payload of the message. That is the expected behaviour.

The following step is map this header data to some target fields for the ABAP proxy.

But, I do not want to put any header fields in the outbound message structure.

Any ideas?

Thank you

Dimitri

former_member181985
Active Contributor
0 Kudos

Hi Dimitri,

Sorry I didn't understand it completely.

Do you mean that you need some of SOAP header fields data from incoming soap message for target abap proxy payload, but at the same time you don't want these SOAP headers for proxy message headers.

Regards,

Praveen Gujjeti

Dimitri
Active Contributor
0 Kudos

Hi Praveen,

Sorry for the confusion. Let me try to be more clear on the requirements.

The sender party puts some things (name, ...) dynamically within the SOAP header. Not in the payload. I need to get those things out of the payload and within some target fields to be pushed to the ABAP proxy.

The only this I do not want is to explicitly define these fields in the payload of the outbound message structure, so I do not want these fields explicitly being mentioned in the WSDL I give to the sender party.

Is that feasible?

Kind regards,

Dimitri

former_member181985
Active Contributor
0 Kudos

Hi Dimitri,

I hope I got you now. In general, the WSDL that we expose in PI for SOAP sender scenarios we always deal with payload structure e.g., input message type, output message type as per your initial screen shots.

Since SOAP sender party application is sending some custom headers of course in soap header and since you enabled don't use soap header in sender soap channel in PI, you get complete SOAP message with envelope in PI . I don't think you have to change your WSDL for your sender party system . Using custom Java or xslt mapping you can form an intermediate message structure (WSDL payload + few extra fields) and then can map intermediate structure to abap proxy structure using simple graphical mapping. You can also achieve this in one java or xslt mapping by directly mapping to proxy structure.

Regards,

Praveen Gujjeti

Dimitri
Active Contributor
0 Kudos

Hi Praveen,


Thank you for your prompt reply.

We are currently using a very simple graphical mapping. Do you mean that we need to extend this?

Or extend the operation mapping with an extra step?

Do you have any example? Or a link to an example?

Thanks a lot.

Kind regards,

Dimitri

former_member181985
Active Contributor
0 Kudos

Hi Dimitri,

Yes correct, you should extend your operation mapping. You can search SDN for some sample java/xslt mappings, but you should customize the code according your structure and requirement.

Regards,

Praveen Gujjeti

Dimitri
Active Contributor
0 Kudos

Hi Praveen

Within my soapUI test tool, I added a small SOAP header

This is how the message enters the SAP PO system:

Now, I should get my name into the target structure to be pushed to the ABAP proxy.

I do not ticked Do Not Use SOAP Envelope within the sender SOAP adapter because I do not want this being in the payload. Otherwise my WSDL is impacted and needs to be changed.

Can I get my name out of it using an extra XSLT mapping within the Operation Mapping or using a UDF within the message mapping?

Thanks a lot.

Dimitri

former_member181985
Active Contributor
0 Kudos

Hi Dimitri,

I think it is not possible to read your custom soap header using XLST or JAVA mapping until and unless you enable "Do Not Use SOAP Envelope" setting in sender soap channel in PI, since with this setting you will get complete SOAP envelope messages as a payload in PI system under XI soap message protocol

Regards,

Praveen Gujjeti

Dimitri
Active Contributor
0 Kudos

Hi Praveen,

If I use that option in the sender SOAP adapter, all is getting into the message payload and I have a problem mapping it to the target.

Kind regards,

Dimitri

former_member181985
Active Contributor
0 Kudos

Hi Dimirti,

Exactly, You have to use java/xslt mapping to form an intermediate message and then map that intermediate message to your actual target message.

Best Regards,

Praveen Gujjeti

Dimitri
Active Contributor
0 Kudos

Hi Praveen,

Using that option in the sender SOAP adapter means that I need to add nosoap=true to the URL in the consuming application and that is not what we want.

I also played around with the option keep headers in the sender SOAP adapter, but I do not see my header in the payload. Any reason why?

This is my test message in soapUI

Only the body is visible as payload on SAP PO.

Kind regards,

Dimitri

former_member181985
Active Contributor
0 Kudos

Hi Dimitri,

>>nosoap=true to the URL in the consuming application and that is not what we want.

May I know the reason why you don't want to use nosoap=true in the SOAP URL

Regards,

Praveen Gujjeti

Dimitri
Active Contributor
0 Kudos

Hi Praveen,

I guess it is the flexibility of the consumer application and they do not seem to work with a URL, but built up the XML dynamically.

Still, the option keep headers should work, isn't?

Kind regards,

Dimitri

Dimitri
Active Contributor
0 Kudos

Hi Praveen,

If I use the option Do Not Use SOAP Envelope in the sender SOAP adapter, how should my data type/message type look like on the outbound side?

After some weeks of testing and trying, I guess we need to adopt the header/body structure into the WSDL and provide it to the consuming party.

Thanks a lot

Dimitri

AntonioSanz
Active Participant
0 Kudos

Dimitri, I faced a similar situation.

please check this link

http://scn.sap.com/thread/3543465

Perhaps it can help you.

Former Member
0 Kudos

Hello Dimitri,

Have you got any solution of the issue ?

I think William's blog answer's that :

http://scn.sap.com/community/pi-and-soa-middleware/blog/2009/07/30/how-to-read-soap-header-informati...

However, It suggests to modify XML structure for sender interface as well. By doing so , it gives other challenge as described below :

If we modify the message structure , it changes the WSDL as well and generating request message something like below :

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:aif="urn://transport.nsw.gov.au/test/poc/aif">

  <soapenv:Header/>

  <soapenv:Body>

      <aif:Envelope>   <------- Added by Modifying the structure

         <Header>

            <FileType>?</FileType>

         </Header>

         <Body>

            <BusinessPartner>

               <!--Optional:-->

How can we use  "Do not use SOAP Envelop" feature without modifying the WSDL structure?

If we don't modify the message structure , it is failing to identify the receiver and also we would not be able to see the fields while doing graphical mapping.

Let me know if you got any other alternative.

Thanks & Regards,

Dijesh Tanna

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Dimitri,

    Normally you will fill the header data in the CC,then you trigger the interface the wsdl will have all the information, but not as structure in the SI.


Hope this helps

Regards

Dimitri
Active Contributor
0 Kudos

Hi Can,

I do understand the behavior, but how can it be a part of the structure is just dropped within the Service Interface?

Kind regards,

Dimitri

Former Member
0 Kudos

So sorry, i can't find more information right now and anyone of my wsdl imported in the SI object has the header info attached.

Regads-

Dimitri
Active Contributor
0 Kudos

Hi Can,

Thank you for your feedback.

I assume you mean within the payload if you say "the header info attached"?

Kind regards,

Dimitri