on 05-11-2006 8:00 AM
Hi Guys
I have a scenario, which calls a webservice from my ABAP Proxies, the twist in this is that SOAP request expects license info into the header of SOAP envelope, I could achive this by XSLT mapping in the receiver SOAP adapter I selected the option "Do not use SOAP envelope" and could do the call.
Due to this the response received from the webservice is treated as payload, as shown below...
response message payload:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Header xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<SubscriptionInfo xmlns="http://ws.strikeiron.com">
<LicenseStatusCode>0</LicenseStatusCode>
<LicenseStatus>Valid license key</LicenseStatus>
<LicenseActionCode>0</LicenseActionCode>
<LicenseAction>Decremented hit count</LicenseAction>
<RemainingHits>18</RemainingHits>
<Amount>0</Amount>
</SubscriptionInfo>
</Header>
<soap:Body>
<getRateResponse xmlns="CurrencyRates">
<getRateResult>44.945</getRateResult>
</getRateResponse>
</soap:Body>
</soap:Envelope>
and when i am trying to do the response mapping, it is not able to read the value.
Anyone having any idea, on how we could do this.
Thanks
Dheeraj
Hi Dheeraj,
I am facing a similar problem as you but I am not able to create an XSD for my structure inspite of using various tools. Can you help me on this.the strucure I need is :
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="urn:enterprise.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sf="urn:sobject.enterprise.soap.sforce.com">
<soapenv:Body>
<queryResponse>
<result>
<done>true</done>
<queryLocator xsi:nil="true"/>
<records xsi:type="sf:Account">
<sf:Id>001P0000003QmPrIAK</sf:Id>
<sf:BillingCity>Something</sf:BillingCity>
</records>
<size>1</size>
</result>
</queryResponse>
</soapenv:Body>
</soapenv:Envelope>
Any help would be appreciated . Thanks
Regards,
Vinithra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dheeraj,
Can you please put forward this solution yoiu developed using the XSLT mapping?
If possible can u send me any documentation you have on this to bhavesh.kantilal@wipro.com.
Regards,
Bhavesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dheeraj,
I could think of two ways but not very sure try it and let me know
1. Instead of doing a XSLT mapping and selecting "Do not use SOAP envelope", try Adapter module. Handle license section there.
2. Try the same XSLT technique during the response... (This is surely doubtful but just a thought)
Thanks,
Prakash
Hi Dheeraj & Bhavesh,
1.In the receiver SOAP adapter under conversion select "<b>Do not use SOAP envelope</b>". (This will ensure no SOAP Envelope is added, meaning its just a payload)
2.(a)Add the adapter module to process the request message (The module that you are specifying here adds the SOAP Envelope). Add the module before the module: sap.com/com.sap.aii.af.soapadapter/XISOAPAdapterBean
<b>OR</b>
(b)As Dheeraj did use a XSLT mapping to add the SOAP Envelope with the additions(License details) In this case there is no need for a adapter module during request message. (This is preffered)
3.Add the adapter module to process the reponse message (The module that you are specifying here removes the SOAP Envelope as we had set "Do not use SOAP envelop" the whole message including SOAP envelope will be in the payload). Add the module after the module: sap.com/com.sap.aii.af.soapadapter/XISOAPAdapterBean
Adapter module prorgamming (You all know this already)
/people/alessandro.guarneri/blog/2006/03/16/xi-mapping-module-for-afw
Dheeraj try this and let us know... I never done this before.
Thanks,
Prakash
Hi Dheeraj,
One more way just striked my mind, correct me if am worng.
Try defining your response strucutre in this fashion
Envelope
Header
SubscriptionInfo
LicenseStatusCode
LicenseStatus
.
.
Body
getRateResponse
getRateResult
So your response payload will fit into this structure and you can access the values during the response mapping. I don't know if this will work, but if this dose we can avoide adapter module and will be a simple solution.
Try and let me know... What do you say Bhavesh?
Thanks,
Prakash
Hi
I am sorry for replying in so late, was busy with some projects.
I got few mails and this post is cathing up again, so thought of giving the solution I followed without any adapter module or anything, simple plain XSLT mapping.
<u><b>Integration Repository</b></u>
1. Created data type and message type for Outbound Interface
2. Imported the WSDL
3. Created an XSD out of the sample response I got by calling the WSDL (this you can do from any tool available, i used the strikeiron website), pls refer below to see the XSD below, and you will have to use the message type envelope from it.
4. Most Important step, created 2 XSLT mappings, one for request and the other for response., Pls refer below for both these mappings.
5. did the interface mapping
<u><b>Integration Directory</b></u>
1. pls configure your scenario as normaly you do, and while you configure the communication channel for your soap receiver, make sure you click on the do not use soap envelop option.
thats it done.
<u><b>XSLT Request Mapping</b></u>
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header>
<LicenseInfo xmlns="http://ws.strikeiron.com">
<RegisteredUser>
<UserID>xyz</UserID>
<Password>xyz</Password>
</RegisteredUser>
</LicenseInfo>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<getConversion xmlns="CurrencyRates">
<FromCurrencyCode>
<xsl:value-of select="//fromCurrency"/>
</FromCurrencyCode>
<ToCurrencyCode>
<xsl:value-of select="//ToCurrency"/>
</ToCurrencyCode>
<Amount>1</Amount>
</getConversion>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
</xsl:template>
</xsl:stylesheet>
<u><b>XSLT Response Mapping</b></u>
<?xml version='1.0' ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:a="CurrencyRates" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<xsl:template match="/">
<ns0:MT_Cur_res xmlns:ns0="http://www.april.in/WebService/SOAPHeader">
<Rate>
<xsl:value-of select="soap:Envelope/soap:Body/a:getConversionResponse/a:getConversionResult"/>
</Rate>
</ns0:MT_Cur_res>
</xsl:template>
</xsl:stylesheet>
<u><b>Webservice Response XSD</b></u>
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://ws.strikeiron.com" xmlns:ns2="CurrencyRates">
<xs:import namespace="CurrencyRates" schemaLocation="ns2.xsd"/>
<xs:import namespace="http://ws.strikeiron.com" schemaLocation="ns1.xsd"/>
<xs:element name="Envelope">
<xs:complexType>
<xs:sequence>
<xs:element ref="soap:Header"/>
<xs:element ref="soap:Body"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Header">
<xs:complexType>
<xs:sequence>
<xs:element ref="ns1:SubscriptionInfo"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Body">
<xs:complexType>
<xs:sequence>
<xs:element ref="ns2:getConversionResponse"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
let me know in case somebody gets stuck somewhere for this scenario.
Take Care
Dheeraj
> Prakash,
> <soap:Envelope
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
>
>
> In this case, dont we need an element by name
> soap:ENVELOPE and isn't the name space actually,
> <i>xmlns:soap="http://schemas.xmlsoap.org/soap/envelo
> pe/"</i>
>
> Regards,
> Bhavesh
not at all, "soap" is just the prefix.
I actually don't know if webservice tools are prepared to expect prefix free soap envelopes, but if they are, you could use
<ns1:Envelope xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/">
without any problems.
Anyway, if you do need prefix-specific message, you can use Anonymizer Module Processor.
Or, forget everything above and just use XSLT mapping.
It's way easier (though much less performing, but I'm considering this is not a concern now).
Regards,
Henrique.
It's just a guess, but considering that mapping engine runs on Java stack (not considering abap mapping), java mapping is probably the most performing of the three, while XSLT is probably the least (since mapping engine will need to run xslt processor and then execute the xslt mapping).
Regards,
Henrique.
Hi,
For your case, it would be much easier to instead use the axis adapter and read the relevant header fields into the dynamic configuration header. Have you considered this approach? The axis adapter FAQ Note 1039369 has several examples illustrating how to read arbitrary header values.
Regards, Yza
Hi Dheeraj!
I also have the problem that I have to create the SOAP envelope by myself (special tags the receiving application expects to find in the SOAP header) but I have no idea how this could work. You said something about XSL, Could you tell me how you did it and eventually even send me a sample?
THIS WOULD BE VERY GREAT!!!
Thanx in advance!
Regards,
Volker
email: vk@bfact.com
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.