cancel
Showing results for 
Search instead for 
Did you mean: 

SOAP receiver adapter error using Google Search web service

Former Member
0 Kudos

Hi all,

I'm trying to connect and old 4.5b system to XI SP16 to make it receive information from external Web Services.

My scenario is made up of a sender RFC adapter and a SOAP receiver which is sending the message to the Google web service (http://api.google.com/GoogleSearch.wsdl) and then awaiting a response from it.

I'm stuck with this error: "No Deserializer found to deserialize a ':key'". The problem is that XI is sending this kind of message:

<m:doGoogleSearch xmlns:m="urn:GoogleSearch" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">

<key>mykey</key>

<q>testing</q>

<start>0</start>

<maxResults>1</maxResults>

<filter>true</filter>

<restrict>String</restrict>

<safeSearch>true</safeSearch>

<lr>String</lr>

<ie>String</ie>

<oe>String</oe>

</m:doGoogleSearch>

while Google is expecting this:

<m:doGoogleSearch xmlns:m="urn:GoogleSearch" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">

<key xsi:type="xsd:string">mykey</key>

<q xsi:type="xsd:string">testing</q>

<start xsi:type="xsd:int">0</start>

<maxResults xsi:type="xsd:int">1</maxResults>

<filter xsi:type="xsd:boolean">true</filter>

<restrict xsi:type="xsd:string">String</restrict>

<safeSearch xsi:type="xsd:boolean">true</safeSearch>

<lr xsi:type="xsd:string">String</lr>

<ie xsi:type="xsd:string">String</ie>

<oe xsi:type="xsd:string">String</oe>

</m:doGoogleSearch>

with explicitly declared xsi:type.

I've tested both messages with XMLSpy and the first one is always returning the same error.

Is there a way to make XI send an XML message with written xsi:type?

Many thanks in advance!

Max

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Massimiliano,

Did you follow the steps that I provide on earlier post?

When I told “create your own data types” It means using the usual data types in XI in graphical mode. But first you need to know what is the compatible element for xsi:type.

Go to http://service.sap.com/xi > Media Library > Documentation and there you will find this xls document -> SAP XI 3.0 (SP11) - Supported XML Schema and WSDL (EN) in this document you have all the compatible elements of wsdl for XI.

After that you are able to do your “soap request” data type and put it with inbound interface to call Google webservice.

Do something identical with data type generated by WSDL (the external definition that you have imported) … and change the xsi:type to the correspondent element compatible with WSDL rpc-based.

You also can do it with XSLT mapping if you want. The mapping that you want is easy to do in XSLT and it is a good idea start learn a bit of XSLT. Check this weblog: /people/r.eijpe/blog/2005/11/04/using-abap-xslt-extensions-for-xi-mapping

Hope it helps,

Ricardo.

Former Member
0 Kudos

Hi Ricardo!

I followed your suggestion to create a simple XSLT mapping program (in the ABAP stack) and I added it to the Interface Mapping in the Integration Repository. The result is exactly the soap message that the Google web-service is expecting.

I'm attaching the XSLT code below in case somebody has the same problem... thanks again for your hint!!

Regards!

Max

<xsl:transform version="1.0"

xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

xmlns:sap="http://www.sap.com/sapxsl"

>

<xsl:strip-space elements="*"/>

<xsl:template match="/">

<ns1:doGoogleSearch xmlns:ns1="urn:GoogleSearch" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema">

<key xsi:type="xsd:string"> <xsl:value-of select= "//key"/> </key>

<q xsi:type="xsd:string"> <xsl:value-of select= "//q"/> </q>

<start xsi:type="xsd:int"> <xsl:value-of select= "//start"/> </start>

<maxResults xsi:type="xsd:int"> <xsl:value-of select= "//maxResults"/> </maxResults>

<filter xsi:type="xsd:boolean"> <xsl:value-of select= "//filter"/> </filter>

<restrict xsi:type="xsd:string"> <xsl:value-of select= "//restrict"/> </restrict>

<safeSearch xsi:type="xsd:boolean"> <xsl:value-of select= "//safeSearch"/> </safeSearch>

<lr xsi:type="xsd:string"> <xsl:value-of select= "//lr"/> </lr>

<ie xsi:type="xsd:string"> <xsl:value-of select= "//ie"/> </ie>

<oe xsi:type="xsd:string"> <xsl:value-of select= "//oe"/> </oe>

</ns1:doGoogleSearch>

</xsl:template>

</xsl:transform>

Former Member
0 Kudos

Hi Max,

It is GOOD to know ;o)

Cheers,

Ricardo.

Answers (1)

Answers (1)

STALANKI
Active Contributor
0 Kudos

check this thread!

Former Member
0 Kudos

Many thanks for your prompt reply!!

I'll follow the hints on the other thread.

At least now I know I'm not the only one with this issue!!

Thanks and regards!

Max

Former Member
0 Kudos

i didnt go through that thread but , i have issue earlier with webservices using RPC format , as i see xi more in to Doc format of WSDL ,

IF YOU DIRECTLY CALL THE URL : I.E. http://api.google.com/search/beta2

You will see it as a soap rpc router.

check inthis perspective also

Vara

[PLEASE REWARD FOR POSTING]