cancel
Showing results for 
Search instead for 
Did you mean: 

WS To Exchange Web Service

Former Member
0 Kudos

Hi Experts,

i´m trying to make a Szenario (WS <-->Exchange web Service). In the Design-Time i have made an OM with 2 Steps for the Request, by customizing the SOAP Envelope. and the Mapping of business data. The Outgoing-Request after MApping is 1-1 with this from Microsoft.

CreateItem operation (calendar item)

in the Configuration i have in der Receiver Channel as follows.

The Receiver Response from the exchange web Service shows like:

<?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">

  <soap:Header>

  <t:ServerVersionInfo MajorVersion="8" MinorVersion="0" MajorBuildNumber="685" MinorBuildNumber="8"

  xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" />

  </soap:Header>

  <soap:Body>

  <CreateItemResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages"

  xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"

  xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">

  <m:ResponseMessages>

  <m:CreateItemResponseMessage ResponseClass="Success">

  <m:ResponseCode>NoError</m:ResponseCode>

  <m:Items>

  <t:CalendarItem>

  <t:ItemId Id="AAAlAFV" ChangeKey="DwAAABYA" />

  </t:CalendarItem>

  </m:Items>

  </m:CreateItemResponseMessage>

  </m:ResponseMessages>

  </CreateItemResponse>

  </soap:Body>

</soap:Envelope>

First question:

Should i remove the Envelope an the Header from the web Service response? If yes How?

Second Question

Without removing the Envelope and Header i get this Error on the receiver Channel:

Thank you very much

Kind Regards

Abdel

Accepted Solutions (1)

Accepted Solutions (1)

Shabarish_Nair
Active Contributor
0 Kudos

first try to test the WS from test tools like SOAPUI. That will give you and idea about the actual Request and Response structures of the Webservice.

Now if you have chosen to customize the calls, and if you are enhancing the envelope, the adapter settings need to reflect the same.

Former Member
0 Kudos

Hi Vijay,

with the SOAPUI all is ok (without PI)

Request:

Response:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">

   <s:Header>

      <h:ServerVersionInfo MajorVersion="14" MinorVersion="2" MajorBuildNumber="318" MinorBuildNumber="2" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"/>

   </s:Header>

   <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

      <m:CreateItemResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">

         <m:ResponseMessages>

            <m:CreateItemResponseMessage ResponseClass="Success">

               <m:ResponseCode>NoError</m:ResponseCode>

               <m:Items>

                  <t:CalendarItem>

                     <t:ItemId Id="AAAYAGZjdF9vbHhkYXRlbkBhbXByaW9uLm5ldABGAAAAAADeh5YuiTHVTqVbo0rkQ6CfBwBG71eAu8dTSYKO3kgyUGN9AAAA+R61AABG71eAu8dTSYKO3kgyUGN9AAAA+YgIAAA=" ChangeKey="DwAAABYAAABG71eAu8dTSYKO3kgyUGN9AAAA+Zx2"/>

                  </t:CalendarItem>

               </m:Items>

            </m:CreateItemResponseMessage>

         </m:ResponseMessages>

      </m:CreateItemResponse>

   </s:Body>

</s:Envelope>

HTTP:Header:

Thank u very much

markangelo_dihiansan
Active Contributor
0 Kudos

Hi Abdel,

What about the HTTP Headers for the request?

Regards,

Mark

Former Member
0 Kudos

Hi

Any reason for adding the soap envelope manually in PI?

Have you tried to call the web service without checking the option 'Do not use SOAP envelop option' in the receiver soap adapter.

Please try that and see if it works or not.

Former Member
0 Kudos

Hi Sarkar,

the exchange web Server need the exact SOAP-Request (name spaces an references), because the Service.wsdl reference to a Schema messages.xsd and Messages.xsd references to Types.xsd

I tried without this and i had "Bad Request error"

see the this:

Thanks @all

Former Member
0 Kudos

Hi Mark,

do you mean the HTTP Header From SAP PI?

Thanks

markangelo_dihiansan
Active Contributor
0 Kudos

Hi Abdel,

There are two http headers, one for request and one for response. The one I'm asking is for the Http header request in soap ui

Regards,

Mark

AntonioSanz
Active Participant
0 Kudos

Hi Abdeljalil,

First question:

Should i remove the Envelope an the Header from the web Service response? If yes How?

>> I think once you check "Do not Use SOAP Envelope" it applies to request and response. So your response mapping should consider that the response message will have SOAP Envelope and Body. Perhaps for this mapping you could use a xslt mapping which returns your MT based ond SOAP response.

Second Question

Without removing the Envelope and Header i get this Error on the receiver Channel:

>> Check what is the SOAP message your are sending to the webservice in PI. As you mentioned, it should have the same SOAP format as when you are using SOAPUI. Perhaps the message is not well formed.

Regards.

Former Member
0 Kudos

Hi Antonio,

thanks for ur reply,

For the Question 2:

The request after Mapping Steps is well formed. I Took this request an i put it in SOAPUI, and i had no Error (without SAP PI).

For ur first answer: Should i  put the xsl-Response Mapping (Customised Envelope) before the business Data Mapping? If yes. I would become  a MT-Structur (in XML) an without SOAP-Construct.

Thanks again

Kind Regards

Abdel

AntonioSanz
Active Participant
0 Kudos

I suggest you to use a xslt mapping in your operation mapping in the Response (there is no need to use a message mapping).

For instance (this is a simply xslt code):

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

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:template match="/">

    <ns1:MT_yourMT xmlns:ns1="http://yournamespace">

        <yourfield1><xsl:value-of select="/*/*/*/field1fromSOAP"/></yourfield1>

        <yourfield2><xsl:value-of select="/*/*/*/field2fromSOAP"/></yourfield2>

    </ns1:MT_yourMT>

  </xsl:template>

</xsl:stylesheet>

This xslt mapping will return

<ns1:MT_yourMT>

        <yourfield1>value1</yourfield1>

        <yourfield2>value2</yourfield2>    

</ns1:MT_yourMT>

So if the xslt mapping fits your mapping needs, there will be no need for a message mapping after it.

Regards.

Answers (0)