Skip to Content

One, quite common requirement on the PI forum has always been a getting an XML file from a web page (in most cases with exchange rates but it can be any other XML file of course). Solution to this issue was in most cases:

– building a java proxy which had to be called inside a ccBPM from a scheduled sender adapter.

– using an external tool (script) – as shown in my other article – PI/XI: how to get an XML file from a web page without own development

Both approaches required either additional development or using some non PI tools – so not very clean. I’ve started wondering if there’s anything else that we could use. It seems that the very old AXIS adapter (available as of XI 3.0) can greatly help in this case.

SOAP sender adapter allows using AXIS extensions and one of the task classes HTTPGetter allows getting an XML file from a URL. In the example below I’m showing how to get the XML file with exchange rates from a web page using a scheduled Axis task.

XML file with exchange rates from http://www.voip.ms/rates/xmlapi.php?dest=United%20States%

What you need to do is to specify:

a) task class,

b) URL (and authentication if exists)

c) interval im miliseconds which will be used to pool the XML file (so once a day for example)

One parameter you need to set for the static URL is the enableREST parameter – you need to set it to true. This will allow proper creation of the PI message from the XML file.

Please have a look at the screenshot below:

And that’s it – there is nothing more you need to do apart from a standard PI flow development.

 

Possible extensions:

Sometimes it’s required to call a sync WS to get a message and there is no special request message for that WS. In such a case the same class (or extension to this class) can be used to do the same thing and you don’t need to use external tools or build special java proxies for such purposes.

 

Please let me know if anyone has already been using this method.

To report this post you need to login first.

58 Comments

You must be Logged on to comment or reply to a post.

  1. Anoop Garg
    Hi Michal,

    I have tested this feature last year on PI 7.11 SP03 but an unsuccessful attempt.

    Get to know, this is supported for PI 7.1 Ehp1 only from SP06 onwards. Source:SAP & Note-1448849.

    It will be nice to have, if you can update PI version with SP patch level information on which it has been successfully tested from your side.

    Thanks,
    Anoop

    (0) 
    1. Michal Krawczyk Post author
      hi Anoop,

      thank you for the note but it does not say anything about EhP1 for 7.1 as there are also patches for PI 7.0 so it should work with 7.0

      also the idea is not only to show that the standard task works but that you can use Axis to implement similar things (using own task classes)
      but more on that soon 🙂

      Thank you for the comment,

      Regards,
      Michal Krawczyk

      (0) 
      1. Srinivas Manda

        My Scenario is to call a rest service, iam using SOAP(Axis) as sender to get the details from the rest service and update in Z table.

        I did the same config as shown in the blog, it seems that the channel is not doing anything.

        Is there any additional config to be done inorder the channel to work. We are on SAP PI 7.1 EHP1.

        Thanks

        Srini

        (0) 
  2. Aaron Myers

    This is a great feature you highlighted Michal!

    Do you know how to find more information on the Task Class options? (e.g. HTTPGetter and enableREST parameter in your case)

    I would like to schedule a polling interval just like this but against a SOAP based web service instead of a simple URL which generates an XML file. I need to pass a <ws: parameter to the web service function to get my XML back. I read help on this but I need more detailed documentation on the Connection Parameters options for the SOAP Axis Task.

    http://help.sap.com/saphelp_nwpi71/helpdata/en/45/a39e244b030063e10000000a11466f/frameset.htm

    (0) 
    1. Michal Krawczyk Post author

      Hi,

      >>>Do you know how to find more information on the Task Class options? (e.g. HTTPGetter and enableREST parameter in your case)

      yes 🙂 just decompile and check – this is that I did 😉

      >>>SOAP based web service instead of a simple URL which generates an XML file.

      this is pretty easy – you just need to copy the standard class and change it accordingly and you’re done – it’s pretty easy with Axis

      Regards,

      Michal Krawczyk

      (0) 
  3. Aaron Myers

    Hi Michal,

    Do you know what Jar the HTTPGetter class resides in? Our Basis team has installed Axis, we see the HTTPSender class and many others living in the Jar files. However, HTTPGetter class is not anywhere to be found!

    Many thanks for any advice on this.

    -Aaron

    (0) 
    1. Aaron Myers

      Sorry, our version of PI service packs was not high enough to use this feature. Although the AXIS protocol/driver option for SOAP has been around for some time, for the HTTPGetter class we must have at least PI 7.11 EHP1 SP6 loaded and we are only at SP3.

      (0) 
  4. Abhishek Vinayaka

    Hi Michael,

    I have a requirement on similar lines. I have a website, which wants data out of ECC. The request from the website is a URL https://abc.com/custid=xyz.  The custid field is dynamic, and would change with every call.  There  is no payload in the inbound http request.  The output is an XML response, based on the custid field

    Can the above solution be used for that,  or we need to implement it as a rest service in ECC ( via SICF handlers)

    Any help would be appreciated.

    Regards,

    (0) 
    1. Michal Krawczyk Post author

      Hi,

      the solution above can be used for static calls (there’s not preceeding call as you see)

      but you can also use AXIS adapter to call rest services in the receiver adapter

      Regards,

      Michal Krawczyk

      (0) 
  5. Juergen Grallert

    Hi Michal,

    we’re on PI 7.11 SP10 and I’ve to implement a scenario for polling exchange rates from the web page of the ecb. I was glad to find your blog and did exactly what you describe.

    But when starting the channel, it’s doing nothing but also no error message. So I restarted the channel and used the XPI Inspector for logging. In the trace, I’ve found the following entry: 

    ~XISOAPAdapterPool.notifyAxisAdapter axis adapter manager is inactive

    Do you have any idea what could be the issue? We have never used Axis before, so could it be that we need to install anything before?

    I’ve also checked the JAR file which Aaron mention above and the HTTPGetter is available.

    Many thanks for any advice in advance!

    Juergen

    (0) 
      1. Juergen Grallert

        Hi Aaron,

        thank you for your comment. I’ve tried the Test-URL before, but always got an error message.

        In the meanwhile I’ve found the information, that I need to create the …axisprovider.sda file first, according to help.sap.com.

        After deploying, the channel is polling working fine.

        Thank you,

        Juergen

        (0) 
        1. ozbk Htc

          Hi !

          I have a problem that I used your blog for my schenario.

          But I have a problem that about coming XML encoding type.

          For example :

          from PI payload : <Type>��zel</Type>

          true form:<Typezel</Type>

          How can I change encoding type?

          All of configuration same with you.

          Hatice ÖZBEK


          (0) 
            1. ozbk Htc

              Thanks Vishal;

              But problem not solved.

              I added AF_Modules/TextCodepageConversionBean Conversion.charset utf-8 before call sap adapter.

              But I wrote the file also same encoding.

              I saw �� when Turkish characters were came.

              Hatice ÖZBEK

              (0) 
        2. Guislain Libessart

          Hi Juergen,

          Can you give me some more details concerning the resolution of your issue ? I do have exactly the same issue : configured as Michael’s blog, channel is in “started” status in CC monitoring but nothing is polling.  PI 7.11 SP06. I have deployed the axis librairies, mandatory components are OK.

          Many Thanks,

          Guislain

          (0) 
          1. Juergen Grallert

            Hi Guislain,

            my issue was, that I didn’t deploy the axis installation before. If you have done this and the check with URL http://<host>:<port>/XIAxisAdapter/MessageServlet is successful, then there seems to be a different issue.

            Any further information in the XPI Inspector?


            Kind regards,

            Juergen

            (0) 
            1. Guislain Libessart

              Hi Juergen,

              Actualy I found where the issue comes from : I redeployed the axis librairies, but I also removed the * in the PARTY field of my Communication Channel, it seems that it does not work with that character.

              Thanks for your quick reply,

              Guislain

              (0) 
  6. S Kumar

    Hi Experts,

    I got to know from above blog that HTTPGetter class can work only above SP6 for SAP PI 7.1. So, could you please confirm if HTTPGetter class can work for SAP PI 7.31 SP 3.

    Thanks,

    Kumar

    (0) 
  7. M. J. M. Cornelissen

    Hi Michal,

    For the HTTPGetter to go outside the network, it needs to use the network-proxy. Does it support that? And if so, how to configure proxy address and portnumber?

    Thanks for your help.

    Michel

    (0) 
    1. Michal Krawczyk Post author

      hi Michel,

      no idea to be honest if this is supported (I’d need to check the available parameters but as far as I remember I didn’t see anything like this) but as it’s a simple class you can always add proxy support I guess, 

      Regards,

      Michal Krawczyk

      (0) 
    2. Sergey Fedechkin

      Hi Michel!

      Please, check note 1788595. Also keep in mind, that there is an issue with proxy authentication described in note 1884289.

      Regards, Sergey.

      (0) 
  8. Sergey Fedechkin

    Hi all.

    Does anybody know, is it possible to get zipped xml via HTTPGetter? For example, zipped xml file.xml.gz ?

    It seems like HTTPGetter tries to parse file as is, that causes the error like An invalid XML character (Unicode: 0x1f) was found in the element content of the document.

    Best regards,

    Sergey.

    (0) 
  9. Srinivas Manda

    Hi Michael,

    I configured the scenario as you described in the blog, But my data is not XML, it is in text format in the webpage.

    I got the following error in the communication channel, do you have any idea about this error?

    error during receive: class org.apache.axis.message.Text:library:com.sap.aii.af.axisproviderlib@com.sap.engine.boot.loader.ResourceMultiParentClassLoader@2a859dc9@alive incompatible with class org.apache.axis.message.SOAPBodyElement:library:com.sap.aii.af.axisproviderlib@com.sap.engine.boot.loader.ResourceMultiParentClassLoader@2a859dc9@alive; nested exception is: java.lang.ClassCastException: class org.apache.axis.message.Text:library:com.sap.aii.af.axisproviderlib@com.sap.engine.boot.loader.ResourceMultiParentClassLoader@2a859dc9@alive incompatible with class org.apache.axis.message.SOAPBodyElement:library:com.sap.aii.af.axisproviderlib@com.sap.engine.boot.loader.ResourceMultiParentClassLoader@2a859dc9@alive

    (0) 
    1. Pradeep Tiwari

      hi Srinivas,

      I have a similar requirement to download a flat file from a website. from the website URL, manually i need to input a date to extract a file which is a flat file. The website not reachable through FTP/FTPS and no web service option available.Does anything of this sort acheivable in PI? and How?

      putting here as found your comment, close to the requirement.

      Thanks

      Pradeep

      (0) 
  10. Roberto Cantero

    Hi experts,

    How can I see active tasks? I trying create an SOAP Axis and looks something is worng:

    SOAPAxis.PNG

    Channel error: “Adapter has not provided any status information about this channel”

    Thanks in advance,

    Roberto.

    (0) 
  11. pavan thiruveedula

    Hi Michael,

    Nice blog, I have a requirement where i need to connect to my target application using restful web services( It is a synchronous interface).

    Is it possible to use SOAP axis adapter for my scenario? If yes, please provide some inputs.

    (0) 
  12. Neha Verma

    Hi All,

    I have followed this blog and configured Sender Axis adapter.

    My scenario is to pull XML file from a URL which is of a RESTful Webservice API. I have deployed required AXIS components and all is in OK status now.

    MY PI version is 7.3 SP 5 and Axis adapter m using is 1.4.

    Now, the adapter is not polling anything nor giving any error. PFB the screenshot.

    Can anyone let me know how to troubleshoot it further and make the channel poll.

    Thanks

    Neha Verma

    (0) 
  13. Rashmi Joshi

    Hi Michal,

    While trying the sender soap axis channel, I am getting communication channel status in error –

    Adapter has not provided any status information about this channel

    Do we need to install axis jar files for using this?

    Currently we do not have axis jar files deployed on PI server –

    Axis Adapter Message Servlet

    Component Versions

    Adapter Common Library Version: 1.7.3114.20141031130932.0000, NW731EXT_14_REL (2014-11-14T22:56:57+0000)
    Adapter Application Version: 1.7.3114.20141031130932.0000, NW731EXT_14_REL (2014-11-14T22:57:38+0000)
    Axis Version: ???

    Required Components

    • Apache-Axis
      Error: required component missing — looking for org.apache.axis.AxisEngine in com.sap.aii.af.axisproviderlib/axis.jar; see http://ws.apache.org/axis/
    • Jakarta-Commons Discovery
      Error: required component missing — looking for org.apache.commons.discovery.Resource in com.sap.aii.af.axisproviderlib/commons-discovery.jar; see http://jakarta.apache.org/commons/discovery/
    • Jakarta-Commons Logging
      Error: required component missing — looking for org.apache.commons.logging.Log in com.sap.aii.af.axisproviderlib/commons-logging.jar; see http://jakarta.apache.org/commons/logging/

    Number of Missing Components: 3
    Status: Error



    BR,

    Rashmi


    (0) 
    1. Maheswarareddy Konda

      Hi Rashmi,

      irrespective of Axis sender or receiver , we need to deploy those jar in our server.

      those missing three has to be installed.once you deply those you can see status OK.

      (0) 
          1. Rashmi Joshi

            Can you please guide me where to find these jar files from ZIP folders?

            I have downloaded

            1. axis-src-1_4.zip

            2. commons-discovery-0.4.zip

            3. commons-logging-1.1.3-src.zip

            I extracted these folders but couldnt find jar files in axis-src-1_4.zip.

            BR,

            Rashmi

            (0) 
  14. Khaja Sk

    hi,

    Once I do all development, This Sender channel not triggering or not pulling data from REST web service, it is not showing error not pulling data. How to trigger this?

    i set interval =300 also

    quality of service = exactly once.

    regards,

    Khaja.

    (0) 
  15. Ashutosh Upadhyay

    Hi Michael,

    Thanks for this great blog, but I am trying to download the ZIP file from a URL and its giving a error.

    So probably we need to change class. Any idea to reslove it quick.

    An invalid XML character (Unicode: 0x3) was found in the element content of the document.

    (0) 
  16. Pernille Midtgaard

    Hi

    I know this is a very old post, but I will comment anyway for those who do not know.

    With the REST adapter (at least the version in 7.5) it is now possible to poll http url for xml content without use of axis or any other stuff than the REST adapter itself.

    (0) 
  17. Bhargav Srinadh Gundabolu

    Hey Michael I have a requirement to call another web-service using SOAP AXIS(Task) sender similar to what you have said in your possible extenstions. I used your blog and the call is made to the other webservice however the service is failing as it is expecting an XML payload. Do you have any idea how to achieve this? 

    (0) 

Leave a Reply