Question: How can I access an SAP system through an RFC?
Answer: Do the following steps:
- Remote enable your function module and publish the web service generated for the RFC
- To understand the SOAP (XML) communication and to get some sample request data for the web service use the freeware soapUI
- Create a sample requests for a web service in soapUI with the WSDL that can be downloaded in soamanager in the NW system. Then you know what xml data is sent to the ERP system and how the response looks like.
- To generate and parse the same, there are a couple of options:
- JSON works fine
- or write your own generator
- In Objective-C you can also simply parse the xml data with NSXMLParser Object (only for parsing, without that CDATA stuff).
In order to bring those web services into the Apple services library, check out the following links:
- The JCO (java connector) provided by SAP has currently no ObjectiveC implementation
What I did to consume an ABAP WebService from an iPhone app is: just create the ABAP WebService, configure the reverse proxy URL in SOAMANAGER, copy the URL, paste it to SOAP UI, generate an example WebService call, copy the generated XML and create an NSMutableString and paste the XML into it and then send an NSMutableURLRequest to the WebService. This works pretty fine and easy in ECC 6.0 and I do not have any trouble using the WSDLs. Of course you have to adjust your coding every time the WSDL changes. But in this case you have to do some other adjustments in your XCode coding anyways.
Plese find an example below:
There is also a JSONParser in objective C that is available in Code Exchange:
It's still in its early days but is functional. Some clean and performance enhancements are needed, that's all work in progress. They are also looking at a JSON generator, but so far the services they are hitting take HTTP Post params and return JSON, so it is not a high priority for them.
If anyone is interested in helping please join the group.