cancel
Showing results for 
Search instead for 
Did you mean: 

Error in webservice call

Former Member
0 Kudos

Hi Gurus,

This is synchronous interface.

Any web application->PI->3rd party webservice

I'm using the receiver SOAP adapter to send the SOAP request message to the

webservice provider.

I imported the WSDL and

created the sender and receiver interfaces. I created teh message mapping and interface mapping.

On the sender side I created the SOAP adapter and defined the provider webservice based on the

sender message interface in PI so that this could be consumed by any web application.

I tested the interface by sending the message to teh Integration Engine, the message failed in the SOAP receiver adapter.

11.04.2012 14:34:07SuccessMessage successfully received by messaging system. Profile: XI URL: http://pihost:50100/MessagingSystem/receive/AFW/XI Credential (User): PIISUSER
11.04.2012 14:34:07SuccessUsing connection SOAP_http://sap.com/xi/XI/System. Trying to put the message into the request queue.
11.04.2012 14:34:07SuccessMessage successfully put into the queue.
11.04.2012 14:34:07SuccessThe message was successfully retrieved from the request queue.
11.04.2012 14:34:07SuccessThe message status set to DLNG.
11.04.2012 14:34:07SuccessDelivering to channel: cc_sendaddressreqtogazops
11.04.2012 14:34:07SuccessMP: Entering module processor
11.04.2012 14:34:07SuccessMP: Processing local module localejbs/sap.com/com.sap.aii.af.soapadapter/XISOAPAdapterBean
11.04.2012 14:34:07SuccessSOAP: request message entering the adapter with user J2EE_GUEST
11.04.2012 14:34:07ErrorSOAP: call failed: java.io.IOException: invalid content type for SOAP: TEXT/PLAIN; HTTP 500 Internal Server Error

Why this error occurred and Could you please suggest any solution to rectify this issue.

Also the URL used to send message to the webservice provider is below

http://webserverhost/uniformgaz/gazopsweb.asmx/DrillDownAddressQuery?sAddressQueryString=4+Rhindmuir...http://webserverhost/uniformgaz2/gazopsweb.asmx/DrillDownAddressQuery?sAddressQueryString=4+Rhindmuir+Drive&picklistcriteria=&si.../uniformgaz2/gazopsweb.asmx/DrillDownAddressQuery?sAddressQueryString=4+Rhindmuir+Drive&picklistcriteria=&singleAddressSelect=&queryReference=&bFuzzy=FALSE&gazID=ECITIZEN&envelope=&securityToken=

The attributes sAddressQueryString,

picklistcriteria,singleAddressSelect,queryReference,bFuzzy,gazID, envelope are available in teh payload and this is defined in the inbound request message type. How can I append these attributes and their values from the payload to the URL . Is there any option available in the receiver SOAP adapter or is this available in the receiver HTTP adapter.

http://webserverhost/uniformgaz2/gazopsweb.asmx/DrillDownAddressQuery?sAddressQueryString=4+Rhindmui...http://webserverhosthttp://arcims2/uniformgaz/gazopsweb.asmx/DrillDownAddressQuery?sAddressQueryString=4+Rhindmuir+Drive.../uniformgaz2/gazopsweb.asmx/DrillDownAddressQuery. Also these values change dynamically at runtime

Any help appreciated.

Thanks,

Jay

Accepted Solutions (0)

Answers (3)

Answers (3)

santhosh_kumarv
Active Contributor
0 Kudos

The issue you are facing is because of the Invalid Content Type. The data that you are sending is of content type TEXT/PLAIN, where as the Webservice provider might be expecting it a different content type.

Once you know the correct content type, you can set that in SAP PI using the MessageTransformBean adapter module.

Eg: Transform.ContentType = application/xml

Refer this blog for an example of how to use this module.

http://scn.sap.com/people/gabrielsagayaselvam.panneerselvam/blog/2009/08/31/solve-key-field-problem-...

~SaNv...

Former Member
0 Kudos

Hi Santhosh,

Thanks for the reply. I can now connect teh webservice and Im getting the response in PI successfully.

I need to define some criteria in PI such if the request is sent to the webservice A and the response contains 0 messages , the request should be routed to another webservice B.

How can we define this condition in PI.

Thanks,

Usha.

former_member184681
Active Contributor
0 Kudos

Hi,

You have to use BPM to achieve this.

Regards,

Greg

Former Member
0 Kudos

Hi Grzegorz,

Thanks for the reply.

The request message sent from PI to webservice A is different from the request message sent to webservice B.

The request message to webservice A:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:add="http://gcc.access.com/AddressLookup">
   <soapenv:Header/>
   <soapenv:Body>
      <add:MT_Address_Full_Req>
         <!--Optional:-->
         <QOS>

            <!--Optional:-->

            <Service>OneScotland Gazetteer</Service>

            <!--Optional:-->

            <Task>AddressLookup</Task>

         </QOS>

         <!--Optional:-->

         <Data_Scope>

            <!--Optional:-->

            <Max_RecsToFetch>100</Max_RecsToFetch>

            <!--Optional:-->

            <TotalResultSetSize></TotalResultSetSize>

            <!--Optional:-->

            <Scope>?</Scope>

         </Data_Scope>

         <!--Optional:-->

         <RequestQuery type="full">

            <Dataset>GLASGOW_ACCESS_SAP</Dataset>

            <!--Zero or more repetitions:-->

            <Attribute matchtype="starts with">

               <Name>search_postcode_no_space</Name>

               <!--1 or more repetitions:-->

               <Value>G134QJ</Value>

            </Attribute>           

            </RequestQuery>

         <!--Optional:-->

         <Response>

            <!--Optional:-->

            <Header>

               <!--Optional:-->

               <ResultCount>?</ResultCount>

               <!--Optional:-->

               <ReturnCount>?</ReturnCount>

               <!--Optional:-->

               <ErrorCode>?</ErrorCode>

               <!--Optional:-->

               <Errormessage>?</Errormessage>

            </Header>

            <!--Optional:-->

            <Result>

               <!--Zero or more repetitions:-->

               <Address>

                  <!--Optional:-->

                  <search_Line_one>?</search_Line_one>

                  <!--Optional:-->

                  <search_postcode_no_space>?</search_postcode_no_space>

                  <!--Optional:-->

                  <UPRN>?</UPRN>

                  <!--Optional:-->

                  <SAO_NO>?</SAO_NO>

                  <!--Optional:-->

                  <S_TEXT>?</S_TEXT>

                  <!--Optional:-->

                  <PAO_NO>?</PAO_NO>

                  <!--Optional:-->

                  <P_TEXT>?</P_TEXT>

                  <!--Optional:-->

                  <STREET_DESCRIPTOR>?</STREET_DESCRIPTOR>

                  <!--Optional:-->

                  <LOCALITY>?</LOCALITY>

                  <!--Optional:-->

                  <ADDRESS_ONE_LINE>?</ADDRESS_ONE_LINE>

                  <!--Optional:-->

                  <ADR03>?</ADR03>

                  <!--Optional:-->

                  <ORT02>?</ORT02>

                  <!--Optional:-->

                  <ORT01>?</ORT01>

                  <!--Optional:-->

                  <PSTLZ>?</PSTLZ>

                  <!--Optional:-->

                  <LAND1>?</LAND1>

                  <!--Optional:-->

                  <ADR04>?</ADR04>

                  <!--Optional:-->

                  <STATE>?</STATE>

                  <!--Optional:-->

                  <FLOOR>?</FLOOR>

                  <!--Optional:-->

                  <DISTANCE>?</DISTANCE>

               </Address>

            </Result>

         </Response>

         <!--Optional:-->

         <Errors>

            <!--Zero or more repetitions:-->

            <Error>

               <!--Optional:-->

               <ErrorCode>?</ErrorCode>

               <!--Optional:-->

               <ErrorDesc>?</ErrorDesc>

               <!--Optional:-->

               <Commentary>?</Commentary>

            </Error>

         </Errors>

      </add:MT_Address_Full_Req>
   </soapenv:Body>
</soapenv:Envelope>

but the SOAP message for the webservice B is

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

<ns1:DrillDownAddressQuery xmlns:ns1="http://www.esriuk.com/gazops">

<ns1:sAddressQueryString>G1 1ET</ns1:sAddressQueryString>

<ns1:picklistcriteria></ns1:picklistcriteria>

<ns1:singleAddressSelect></ns1:singleAddressSelect>

<ns1:queryReference></ns1:queryReference>

<ns1:bFuzzy>false</ns1:bFuzzy>

<ns1:gazID>ECITIZEN</ns1:gazID>

<ns1:envelope></ns1:envelope>

<ns1:securityToken></ns1:securityToken>

</ns1:DrillDownAddressQuery>

So I use the 2nd interface to get teh address details from webservice B. If the webservice B is having 0 messages in the response then this should be routed to webservice A. Here the payload for teh secng webservice is different.

How I can link two interfaces given teh adress search for POST Code.

If this can be achieved using BPMs canyou please send the link for BPMs sample scenarios.

Thanks,

Jay.

Former Member
0 Kudos

Hi ,

First the search for address is performed using webservice B . If the result of this operation contains "No Match Found" as follows

DrillDownAddressQueryResult><GAZOPS_DATA_REQUEST operation="ADDRESS_MATCH"><OPERATION_RESULT>No Match Found</OPERATION_RESULT></GAZOPS_DATA_REQUEST></DrillDownAddressQueryResult>

then the request should be directed to second webservice by using the value in the request message payload

but for the second message the payload in the SOAP message is different from the first one.

How can we achieve this using BPMs.Any help appreciated

Thanks,

Jay.

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

 Is there any option available in the receiver SOAP adapter or is this available in the receiver HTTP adapter. 

http://webserverhost/uniformgaz2/gazopsweb.asmx/DrillDownAddressQuery?sAddressQueryString=4+Rhindmui...http://webserverhosthttp://arcims2/uniformgaz/gazopsweb.asmx/DrillDownAddressQuery?sAddressQueryString=4+Rhindmuir+Drive.../uniformgaz2/gazopsweb.asmx/DrillDownAddressQuery. Also these values change dynamically at runtime

You can use dynamic configuration to build the whole URL.

http://help.sap.com/saphelp_nwpi711/helpdata/en/48/327519a3af58d8e10000000a421937/frameset.htm

The technical name for that is TServerLocation, take note that once you used dynamic config, the username/password for authentication should also be included in your dynamic config using TAuthKey (Authorization Keys).

Your URL should not reach more than 200 characters because it is a technical limitation of PI. It is best to talk to the webservice provider if that is the case and ask them that you provide the values in the HTTP Body instead.

Hope this helps,

Mark

baskar_gopalakrishnan2
Active Contributor
0 Kudos

>On the sender side I created the SOAP adapter and defined the provider webservice based on the

Ignore the earlier reply. Updating the rely. Yes, I see that you do soap to soap scenario. Though it is not better practice to send the values as query string, You can try using conversion parameter and choose query string option in the soap receiver channel.  This way you can post the values as query string. Even Plain http adapter supports this.

Message was edited by: Baskar Gopalakrishnan