cancel
Showing results for 
Search instead for 
Did you mean: 

Rest Web service using SOAP Axis adapter

Former Member
0 Kudos

Hi,

Iam developing a scenario RFC--PI -- Rest service.

I went to the following blogs

http://wiki.sdn.sap.com/wiki/display/XI/REST+Web+Services+in+XI+(Proof+of+Concept)

But as per the blog, some customisation to be done for HTTP adapter - we dont want to do this way

Then i came across AXIS adapter where we call the rest service. So i used rest adapter but it is giving the error.

<SAP:AdditionalText>com.sap.engine.interfaces.messaging.api.exception.MessagingException:
javax.ejb.EJBException: Exception in getMethodReady() for stateless bean
sap.com/com.sap.aii.axis.app*xml|com.sap.aii.adapter.axis.ejb.jar*xml|AFAdapterBean;
nested exception is: com.sap.engine.services.ejb3.util.pool.PoolException:
javax.ejb.EJBException: Exception raised from invocation of public void
com.sap.aii.adapter.axis.modules.AFAdapterBean.ejbCreate() throws
javax.ejb.CreateException method on bean instance
com.sap.aii.adapter.axis.modules.AFAdapterBean@7eb4fc76 for bean
sap.com/com.sap.aii.axis.app*xml|com.sap.aii.adapter.axis.ejb.jar*xml|AFAdapterBean;
nested exception is: javax.ejb.CreateException: java.lang.NoClassDefFoundError:
org/apache/axis/types/URI$MalformedURIException
</SAP:AdditionalText>
My Config is as follows
Adapter Type: SOAP
Transport Protocol : HTTP(Axis)
Message Protocol: Axis
Adapter Engine: Central Adapter engine
Authentication; None
SOAP Version: 1.1
SOAP Action : HTTP GET
Encapsulation Format : MIME
Keep XI Headers: X
Keep Attachments: X
Payload Extraction: SOAP Body
Please guide me how to correct this error
Thanks
Srinivas

Accepted Solutions (0)

Answers (3)

Answers (3)

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

Make sure you have deployed the necessary Axis components by going to this URL:

http://host:port/XIAxisAdapter/MessageServlet

The status for the required components should be okay. Here is a sample blog by Michal regarding the use of the SOAP Axis Sender for HTTP GET, take note of the URL escaping after the query string e.g United States is equal to United%20States if you use URL escaping..

http://scn.sap.com/people/michal.krawczyk2/blog/2012/01/05/michals-pi-tips-exchange-rates-from-an-xm...

Hope this helps,

Mark

Former Member
0 Kudos

Dear Srinivas

Why do you want to use Soap Axis.

Go with

a. Use http adapter

b. Soap Adpater with no soap envelope.

regards

Monika

Former Member
0 Kudos

Can anybody suggest how to proceed on this

baskar_gopalakrishnan2
Active Contributor
0 Kudos

You might want to try using plain http adapter to consume rest web service. Since this webservice does not need envelope and header details, I think it should be possible. If not, soap adapter with no envelope option would do.

Also I want you to see the other option given in the link

https://www.advantco.com/product/REST

Hope that helps.

Former Member
0 Kudos

Hello,

I used the soap adapter with option (No SOAP envelope), iam able to get the response from the service.

iam calling the below URL

http://www.voip.ms/rates/xmlapi.php?dest=United%20States% and the response is

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

<results>
  <item>
    <short_description>USA</short_description>
    <description>United States</description>
    <pattern>1</pattern>
    <rate>0.01050000</rate>
    <rate_premium>0.01250000</rate_premium>
    <increment>6</increment>
    <old_rate>0.00000000</old_rate>
    <old_rate_change>2009-10-31</old_rate_change>
  </item>

</results>

bu the issue is when iam mapping the response to the traget iam getting an message mapping error because the payload is of plain text.How can i map to the target? do i need to write java mapping inorder to do this?

Thanks

Srinivas

baskar_gopalakrishnan2
Active Contributor
0 Kudos

> when iam mapping the response to the traget iam getting an message mapping error because the payload is of plain text.How can i map to the target? do i need to write java mapping inorder to do this?

Yes. If the target system requires soap header details or some namespace details then you need to create those information using XSLT or java mapping. In your operation mapping, this XSLT or java mapping will be the first interface mapping followed by message mapping. This way you can complete the response mapping.