cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping Array string response from Web service

Former Member
0 Kudos

Hi

Need to map the response from a sync call to a WS which contains an array of strings the response message looks like:

- <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

- <SOAP-ENV:Body>

- <rpl:readAllRecFromDQStrArrayResponse xmlns:rpl="urn:AS400DBAccessVi">

- <rpl:Response xmlns:pns="urn:java/lang">

<pns:String>Row 1</pns:String>

<pns:String>Row 2</pns:String>

<pns:String>Row 3</pns:String>

</rpl:Response>

</rpl:readAllRecFromDQStrArrayResponse>

</SOAP-ENV:Body>

</SOAP-ENV:Envelope>

Need to map it to the following MT:

WSResponse

Response String 1..unbounded

Accepted Solutions (0)

Answers (8)

Answers (8)

Former Member
0 Kudos

I created the MT manually (was previously importing them from the WSDL generated by the WS). Did not use the complex type 'arrayofstring' used a normal string type and it worked.

See the ffg doc to create MT :

<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d23cbe11-0d01-0010-5287-873a22024f79">https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d23cbe11-0d01-0010-5287-873a22024f79</a>

Former Member
0 Kudos

Solved the problem, thanks all for your input.

bhavesh_kantilal
Active Contributor
0 Kudos

Can you let us know how you solved the issue?

Regards

Bhavesh

Former Member
0 Kudos

You are correct that array values cannot be passed to a webservice, but my issue is related to the response which is an array.

Former Member
0 Kudos

response from Xi or webserivces

bhavesh_kantilal
Active Contributor
0 Kudos

Nivendra,

The Same logic that holds for Request Also holds good for Response.

As far as I know, XI cannto handle a Array Type in the response.

Regards

Bhavesh

Former Member
0 Kudos

Hi Udo

This the the source and target:

SOURCE:

<?xml version="1.0" encoding="ISO-8859-1"?>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:AS400DBAccessWsd/AS400DBAccessVi/rpc" targetNamespace="urn:AS400DBAccessWsd/AS400DBAccessVi/rpc">

<xsd:import namespace="urn:java/lang" />

<xsd:element xmlns:ns1="urn:java/lang" name="Response" type="ns1:ArrayOfString" />

</xsd:schema>

TARGET:

<?xml version="1.0" encoding="ISO-8859-1"?>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://dubal.ae/SOP/SD003" targetNamespace="http://dubal.ae/SOP/SD003">

<xsd:element name="executeDQResponse" type="executeDQResponse" />

<xsd:complexType name="executeDQResponse">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

4c98a2b0c22d11dbbd74001125bd7544

</xsd:appinfo>

</xsd:annotation>

<xsd:sequence>

<xsd:element name="String" type="xsd:string" minOccurs="0" maxOccurs="unbounded">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

09d279c0c01011dbb867001641ad833b

</xsd:appinfo>

</xsd:annotation>

</xsd:element>

</xsd:sequence>

</xsd:complexType>

</xsd:schema>

Thanks

Former Member
0 Kudos

u cant pass array values to webservices

udo_martens
Active Contributor
0 Kudos

Hi Nivendra,

which type of mapping do you want to use?

Anyway: Where is the problem? The task seems to be not very complex?

Can you give an example for target XML?

Regards,

Udo

Former Member
0 Kudos

My question is specifically around the mapping. The response form the WS contains multiple records hence the array.

Former Member
0 Kudos

Hi Nivendra,

create a msg interface for WSResponse MT.......in ID, create a comm channel to communicate with your web-service.....create a sender or receiver agreement as your scenario needs and in that specify the msg interface and your comm channel.

Thanks,

Rajeev Gupta

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

I dont XI supports Array Datatype in the WSDL's.

You might have to ask the Webservice to change this.

Regards

Bhavesh