Calling ABAP BAPIs from a JAVA client - Web Services vs. JCo

Hi All,
When calling BAPIs from a JAVA client, what are the pros/cons for making the call employing JCo vs web service technologies.  I understand that using SOAP would play better into the SOA theme and that there are nice tools to generate a WSDL document from a BAPI.  Aside from the obvious, are there any performance considerations and/or other major pros/cons to each
Thanks,
Mark

Hi Mark,
Have you got any information on this. If you have any information on this pls forward to me at <b>[email protected]</b> I am also having this confusion. My question is a bit deviating from your point. If we use XI when developing WDJs with WS, will it help in improving performance and maintenance.will it give any advantage if I use XI with BAPIs to connecto backend from WDJ apps. I got this confusion, becasue of a requirement to develop WDJ apps that will be accessed by 50,000 users. Somebody told client that use of XI willimprove performance.
Any help is greatful
Regards
Ravindra
Message was edited by:
        Ravindra Babu Tanguturi

Similar Messages

  • Problem with special charecter while calling a BAPI from Webdynpro JAVA.

    Hi Experts,
    I am calling a BAPI from Webdynpro JAVA. I am passing a special charecter  u2018 as input to BAPI. But I am getting a # as input in R/3.. Can any one explain why it is getting changed?
    Any inputs regarding this issue are appreciated.
    Thanks,
    Kasinath.

    Hi,
        I had same problem before..For this I have created function module in backend for removing #. It was for converting Stream to ITF text.
    CONVERT_STREAM_TO_ITF_TEXT.
    Try this.
    Thanks,
    Prajakta

  • How do I call an ejb from a java client?

    I put ejb classes in a jar file along with java client code and deployed it on my OC4J server. Now I am trying to run the ejb by calling the client code on my OC4J server from the command line but I am not having success. Am I doing this the right way? Should I also deploy my client code? Should the client code also be in a directory on my OC4J server?
    Mike

    Hi. Here is a part of the code for a java client. In this particular case it is also an EJB but it is a Message Driven Bean.
    public class MDBEjbMecomsIFSBean implements MessageDrivenBean,
    MessageListener {
    // context
    private MessageDrivenContext m_ctx = null;
    // properties filename
    private String m_propFile = DEF_PROPFILE;
    // application
    private String m_app;
    // callable function from properties
    // private String m_dsJndiName;
    // private String m_dsType;
    // private String m_dsFunc;
    private int m_connRetryMax;
    private int m_connRetryWait;
    // initial stylesheet transformation file
    private String m_xsltFile;
    // web service operation name
    private String m_operationName;
    // trap emitter members from properties
    private String m_trapMbeanURL;
    private String m_trapObjectName;
    private String m_trapAction;
    private String m_trapAppName;
    private Severity m_trapMax = Severity.CRITICAL;
    private int m_trapAfterDelivery;
    private boolean m_trapStart;
    // jmx members for auto shutdown from properties
    private String m_mdbMbeanURL;
    private String m_mdbMbeanAccount;
    private String m_mdbMbeanPassword;
    private String m_mdbObjectName;
    private String m_mdbAutoShutdown;
    // clob allocator to be used by Oracle jdbc call
    // private CLOB m_clob;
    * Remember the context for this MDB.
    * @param ctx the context for this MDB
    public void setMessageDrivenContext(MessageDrivenContext ctx) {
    logger.log(Level.FINEST, "Setting MessageDrivenContext");
    m_ctx = ctx;
    * ejbCreate() is called when the server wants to create a new instance of this MDB.
    * At this time a connection with the target is established and the callable statement
    public void ejbCreate() {
    readProperties();
    // Connection errors are IGNORED, because it seems that raising Exceptions from here
    // does NOT result in a container managed rollback. Instead the dequeue is commited,
    // resulting in AQ message status 2 (success).
    // By ignoring the fault, another Exception will occurr in onMessage(), from where
    // a propagated exception DOES result in a rollback.
    String logStr = "Started TenneT-MDB-" + m_app;
    logger.log(Level.FINEST, prefixLog(logStr));
    if (m_trapStart)
    notify(Severity.NORMAL, logStr);
    * This method is called whenever a message is sent to the queue associated with this MDB.
    * @param msg assumed to be a javax.jms.TextMessage containting an xml string
    public void onMessage(Message msg) {
    * msg id, timestamp and length are logged at info level
    * msg content is logged at debug level
    String msgText = "uninitialized";
    String msgId = "undefined";
    int msgDeliveryCount = 0;
    // this block retrieves msg info from the jms header
    // errors are logged as info and ignored
    try {
    // get msgid first so any subsequent error can be associated with the msg
    msgId = msg.getJMSMessageID();
    logger.log(Level.FINE, prefixLog("MessageID: " + msgId));
    logger.log(Level.FINE,
    prefixLog("Enq_time : " + msg.getJMSTimestamp()));
    // delivery count can be used to send a critical trap only on the last retry
    if (msg.propertyExists(JMS_X_RCV_TIMESTAMP)) {
    logger.log(Level.FINE,
    prefixLog("Deq_time : " + msg.getIntProperty(JMS_X_RCV_TIMESTAMP)));
    // delivery count can be used to send a critical trap only on the last retry
    if (msg.propertyExists(JMS_X_DELIVERY_COUNT)) {
    msgDeliveryCount = msg.getIntProperty(JMS_X_DELIVERY_COUNT);
    logger.log(Level.FINE,
    prefixLog("DeliveryCnt: " + msgDeliveryCount));
    } catch (Exception e) {
    String errStr =
    "Minor exception in JMSConsumeMDBBean.onMessage() receiving msg \"" +
    msgId + "\": " + e.getMessage();
    logger.log(Level.SEVERE, prefixLog(errStr));
    // next the message content is addressed
    try {
    TextMessage message = (TextMessage)msg;
    msgText = message.getText();
    logger.log(Level.FINE,
    prefixLog("MessageLength: " + msgText.length()));
    logger.log(Level.FINEST, prefixLog("Msg: " + msgText));
    } catch (Exception e) {
    String errStr =
    "Error in JMSConsumeMDBBean.onMessage() retrieving msg \"" +
    msgId + "\": " + e.getMessage();
    logger.log(Level.SEVERE, prefixLog(errStr));
    notify(Severity.CRITICAL, errStr);
    throw new EJBException(errStr);
    // From now we can do intial stylesheet transformation if necessary
    try {
    // Prepare input
    XMLDocument xslInput;
    XMLDocument xmlInput;
    DOMParser parser = new DOMParser();
    parser.setPreserveWhitespace(true);
    // Parse XSL
    parser.parse((MDBEjbMecomsIFSBean.class.getResourceAsStream(m_xsltFile)));
    xslInput = parser.getDocument();
    // Parse XML
    parser.parse((Reader)new StringReader(msgText));
    xmlInput = parser.getDocument();
    // Instantiate XSL Processor
    XSLProcessor processor = new XSLProcessor();
    XSLStylesheet stylesheet;
    stylesheet = processor.newXSLStylesheet(xslInput);
    XMLDocumentFragment xmlOutput =
    (XMLDocumentFragment)processor.processXSL(stylesheet,
    xmlInput);
    // Now prepare xml for use with entity bean
    Document xmlDoc = new XMLDocument();
    xmlDoc.appendChild(xmlOutput);
    *// Invoke Entity Bean to perform lookup of destination Web Service*
    Context ctx;
    ctx = new InitialContext();
    EBEjbMecomsIFSLocalHome ebOppIfsLH =
    *(EBEjbMecomsIFSLocalHome)ctx.lookup("java:comp/env/ejb/local/EBEjbopp_ifs");*
    EBEjbMecomsIFSLocal ebOppIfs;
    ebOppIfs = ebOppIfsLH.create();
    *// pass message content to entity bean*
    ebOppIfs.setXMLmessage((Element)xmlDoc.getDocumentElement());
    *// provide correct soap action*
    ebOppIfs.setOperationName(m_operationName);;
    *// do actual work*
    ebOppIfs.doWork();
    } catch (XSLException e) {
    logger.log(Level.INFO,
    prefixLog("XSL Exception during onMessage " +
    e.getMessage()));
    } catch (SAXException e) {
    logger.log(Level.INFO,
    prefixLog("SAX Exception during onMessage " +
    e.getMessage()));
    } catch (CreateException e) {
    logger.log(Level.INFO,
    prefixLog("Create Exception during onMessage " +
    e.getMessage()));
    } catch (NamingException e) {
    logger.log(Level.INFO,
    prefixLog("Naming Exception during onMessage " +
    e.getMessage()));
    } catch (IOException e) {
    logger.log(Level.INFO,
    prefixLog("IO Exception during onMessage " + e.getMessage()));
    private void notify(Severity severity, String message) {
    logger.log(Level.FINEST,
    prefixLog("Started method notify() with severity level " +
    severity));
    try {
    if (m_trapMbeanURL == null || m_trapMbeanURL.equals("")) {
    logger.log(Level.WARNING,
    prefixLog("No MBean URL! Skipping SNMP trap."));
    } else {
    logger.log(Level.INFO,
    prefixLog("Setting up JMX connection with " +
    m_trapMbeanURL));
    ObjectName delegateName = null;
    MBeanServerConnection mbsc = null;
    try {
    JMXServiceURL jmxServiceURL =
    new JMXServiceURL(m_trapMbeanURL);
    JMXConnector connector =
    JMXConnectorFactory.connect(jmxServiceURL);
    mbsc = connector.getMBeanServerConnection();
    delegateName = new ObjectName(m_trapObjectName);
    logger.log(Level.FINEST,
    prefixLog("JMX connection established with " +
    m_trapMbeanURL));
    } catch (Exception ex) {
    logger.log(Level.SEVERE,
    prefixLog("Error while initializing JMX Server connection"),
    ex);
    throw new EJBException("Error while initializing JMX Server connection",
    ex);
    String localHost = null;
    try {
    InetAddress addr = InetAddress.getLocalHost();
    localHost = addr.getCanonicalHostName();
    logger.log(Level.FINEST,
    prefixLog("Localhost=" + localHost));
    } catch (UnknownHostException ex) {
    logger.log(Level.SEVERE, prefixLog(ex.getMessage()), ex);
    throw new EJBException(ex.getMessage(), ex);
    // invoke the trapemitter
    try {
    if (mbsc != null) {
    if (severity.ordinal() > m_trapMax.ordinal()) {
    severity = m_trapMax;
    String severityArg = severityMap.get(severity);
    Object[] arguments =
    { severityArg, message, m_trapAppName, localHost };
    String[] signature =
    { "java.lang.String", "java.lang.String",
    "java.lang.String", "java.lang.String" };
    mbsc.invoke(delegateName, m_trapAction, arguments,
    signature);
    logger.log(Level.INFO,
    prefixLog("TrapEmitter invoked: severity=" +
    severityArg + " - message=" +
    message));
    } else {
    logger.log(Level.SEVERE,
    prefixLog("Error: No MBean server connection established with " +
    m_trapMbeanURL));
    } catch (MBeanException e) {
    logger.log(Level.SEVERE,
    prefixLog("Error occured in invoked method"),
    e);
    } catch (ReflectionException e) {
    logger.log(Level.SEVERE, prefixLog(e.getMessage()),
    e.getCause());
    } catch (IOException e) {
    logger.log(Level.SEVERE,
    prefixLog("A communication problem occurred when talking to the MBean server"),
    e);
    } catch (InstanceNotFoundException e) {
    logger.log(Level.SEVERE,
    prefixLog("The MBean specified is not registered in the MBean server."),
    e);
    } catch (Exception e) {
    logger.log(Level.SEVERE,
    prefixLog("Error in method notify. Handling resumes..."));
    } finally {
    if (severity.equals(Severity.CRITICAL)) {
    stopConsuming();
    private void stopConsuming() {
    logger.log(Level.FINEST, prefixLog("Started method stopConsuming()"));
    if ("true".equals(m_mdbAutoShutdown)) {
    if (m_mdbMbeanURL == null || m_mdbMbeanURL == "") {
    logger.log(Level.WARNING,
    prefixLog("No MDB MBean URL! Skipping stopConsuming()."));
    } else {
    JMXConnector jmxCon = null;
    try {
    Hashtable<String, String> credentials =
    new Hashtable<String, String>();
    credentials.put("login", m_mdbMbeanAccount);
    credentials.put("password", m_mdbMbeanPassword);
    // Properties required to use the OC4J ORMI protocol
    Hashtable env = new Hashtable();
    env.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES,
    "oracle.oc4j.admin.jmx.remote");
    env.put(JMXConnector.CREDENTIALS, credentials);
    JMXServiceURL serviceUrl =
    new JMXServiceURL(m_mdbMbeanURL);
    jmxCon =
    JMXConnectorFactory.newJMXConnector(serviceUrl, env);
    jmxCon.connect();
    MBeanServerConnection mbs =
    jmxCon.getMBeanServerConnection();
    logger.log(Level.FINEST,
    prefixLog("JMX connection established with " +
    m_mdbMbeanURL));
    ObjectName objectName = new ObjectName(m_mdbObjectName);
    MessageDrivenBeanMBeanProxy MDBMBean =
    (MessageDrivenBeanMBeanProxy)MBeanServerInvocationHandler.newProxyInstance(mbs,
    objectName,
    MessageDrivenBeanMBeanProxy.class,
    false);
    MDBMBean.stop();
    logger.log(Level.WARNING,
    prefixLog("Message consumption suspended"));
    } catch (Exception ex) {
    logger.log(Level.SEVERE,
    prefixLog("Error while initializing JMX Server connection"),
    ex);
    throw new EJBException("Error while initializing JMX Server connection",
    ex);
    } else {
    logger.log(Level.WARNING,
    prefixLog("No AutoShutdown. property=false"));
    * Called when the server no longer wants to keep this MDB instance.
    * Closes the connection and statement objects created in <code>ejbCreate</code>.
    public void ejbRemove() {
    try {
    cleanup();
    } catch (Throwable t) {
    logger.log(Level.SEVERE,
    prefixLog("Error in ejbRemove(): " + t.getMessage()));
    /* Cleanup resources cleanly */
    private void cleanup() {
    logger.log(Level.INFO, prefixLog("TenneTMDB.cleanup() called."));
    // m_dsService = null;
    // m_dsCall = null;
    private String prefixLog(String logText) {
    String logPrefix = "%" + m_app + ": ";
    //System.out.println(logPrefix + logText);
    return logPrefix + logText;
    private void logCause(Throwable e, LogLevel logLevel) {
    int i = 0;
    String causeStr;
    Throwable exception = e.getCause();
    while (exception != null) {
    i++;
    causeStr = "Cause " + i + ": " + exception.getMessage();
    switch (logLevel) {
    case INFO:
    logger.log(Level.INFO, prefixLog(causeStr));
    break;
    case WARN:
    logger.log(Level.WARNING, prefixLog(causeStr));
    break;
    case ERROR:
    logger.log(Level.SEVERE, prefixLog(causeStr));
    exception = exception.getCause();
    }

  • Call ABAP FM from XI Java mapping

    Can you please provide me some documentation on how to make a call to ABAP function module from Java mapping.
    Basically this would be a RFC lookup from Java mapping.
    Any recomendations on which one is a standard approach among ABAP Mapping vs JAVA mapping within XI.
    Your responses are appreciated.
    TNV

    Hi TNV,
    <i>I am more looking into using RFC call from java mapping.</i>
    The article by Michal can be used to make the RFC lookup not only from an User Defined Function but also from a java mapping.
    You can write any piece of java code inside the EXECUTE() method of your Java Mapping including the RFC Lookup API code in michal's article.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/xi-code-samples/xi%20mapping%20lookups%20rfc%20api.pdf
    Regards.
    Bhavesh

  • Java Client Web Service In Platform Eclipse

    Hi All
    I have created a server Web Service called LoanCalcService in VS.NET 2005, the folder contains LoanInfo.asmx that when run creates the Web Service, WSDL. Which works good.
    Now i need to send a request to the Web Service server and get a response from the LoanCalcService that it provides. To do this i must create a client in another language. I am doing this in JAVA in the Eclipse platform.
    I have tested the WSDL with the web service explorer that comes with eclipse and the program works good. But when i run the Java code in Eclipse i get this
    Error
    HTTP Status 404 - /WebServiceProject/WEB-INF/classes/localhost/LoanCalcService/LoanInfo_asmx/LoanInfoLocator.java
    type Status report
    message /WebServiceProject/WEB-INF/classes/localhost/LoanCalcService/LoanInfo_asmx/LoanInfoLocator.java
    description The requested resource (/WebServiceProject/WEB-INF/classes/localhost/LoanCalcService/LoanInfo_asmx/LoanInfoLocator.java) is not available
    Can anyone tell me please what i am missing please.
    Thank You beforehand

    You are a novice to Java and yet you expect to start out writing services?
    Good luck with that*
    *Trademark, 2006- yawmark, All Rights Reserved.                                                                                                                                                                                                                                                                                                   

  • XI 3.0 and external Java client/web service

    Hello,
    I'm desperately tryin' to get an external system to work together with XI 3.0.
    The setup is quite simple:
    The external system is nothing but a simple Java program sending SOAP-based requests to a webservice. It is based on AXIS and is running satisfyingly when connecting directly to an appropriate Tomcat/AXIS-based web service, see the following communication.
    -- local request
    POST /axis/VAPService.jws HTTP/1.0
    Content-Type: text/xml; charset=utf-8
    Accept: application/soap+xml, application/dime, multipart/related, text/*
    User-Agent: Axis/1.1
    Host: 192.168.1.2:8080
    Cache-Control: no-cache
    Pragma: no-cache
    SOAPAction: "http://localhost/SOAPRequest"
    Content-Length: 422
    <?xml version="1.0" encoding="UTF-8"?>
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
      <SOAPRequest soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
       <SOAPDataIn xsi:type="xsd:string">890000001</SOAPDataIn>
      </SOAPRequest>
    </soapenv:Body>
    </soapenv:Envelope>
    -- local response
    HTTP/1.1 200 OK
    Set-Cookie: JSESSIONID=DFD7A00A244C18A058FCB52A8321A167; Path=/axis
    Content-Type: text/xml;charset=utf-8
    Date: Mon, 23 Aug 2004 06:52:47 GMT
    Server: Apache-Coyote/1.1
    Connection: close
    <?xml version="1.0" encoding="UTF-8"?>
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
      <SOAPRequestResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
       <SOAPRequestReturn xsi:type="xsd:int">1</SOAPRequestReturn>
      </SOAPRequestResponse>
    </soapenv:Body>
    </soapenv:Envelope>
    Now I have designed and configured simple business scenarios with XI 3.0 (synchronous as well as asynchronous). The only response I get from XI when the Java client connects ist the following:
    -- remote request
    POST /sap/xi/engine?type=entry HTTP/1.0
    Content-Type: text/xml; charset=utf-8
    Accept: application/soap+xml, application/dime, multipart/related, text/*
    User-Agent: Axis/1.1
    Host: <host>:<port>
    Cache-Control: no-cache
    Pragma: no-cache
    SOAPAction: "http://soap.org/soap"
    Content-Length: 424
    <?xml version="1.0" encoding="UTF-8"?>
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
      <SOAPRequest soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
       <SOAPDataIn xsi:type="xsd:string">890000001</SOAPDataIn>
      </SOAPRequest>
    </soapenv:Body>
    </soapenv:Envelope>
    -- remote response
    HTTP/1.0 500 HTTP standard status code
    content-type: text/xml
    content-length: 1493
    content-id: <[email protected]>
    server: SAP Web Application Server (1.0;640)
    <SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP:Header>
    </SOAP:Header>
    <SOAP:Body>
    <SOAP:Fault xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:wsu="http://www.docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsse="http://www.docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" SOAP:mustUnderstand="1">
       <SOAP:faultcode>Client</SOAP:faultcode>
       <SOAP:faultstring></SOAP:faultstring>
       <SOAP:faultactor>http://sap.com/xi/XI/Message/30</SOAP:faultactor>
       <SOAP:faultdetail>
          <SAP:Error xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:wsu="http://www.docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsse="http://www.docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" SOAP:mustUnderstand="1">
             <SAP:Category>XIProtocol</SAP:Category>
             <SAP:Code area="PARSER">UNEXSPECTED_VALUE</SAP:Code>
             <SAP:P1>Main/@versionMajor</SAP:P1>
             <SAP:P2>000</SAP:P2>
             <SAP:P3>003</SAP:P3>
             <SAP:P4></SAP:P4>
             <SAP:AdditionalText></SAP:AdditionalText>
             <SAP:ApplicationFaultMessage namespace=""></SAP:ApplicationFaultMessage>
             <SAP:Stack>XML tag Main/@versionMajor has the incorrect value 000. Value 003 expected
             </SAP:Stack>
          </SAP:Error>
       </SOAP:faultdetail>
    </SOAP:Fault>
    </SOAP:Body>
    </SOAP:Envelope>
    I made sure the business service in the integration directory is named SOAPRequest and is using SOAP as the communication channel. As the adapter engine I chose the integration server, since it is the only option, although the SOAP adapter framework is installed (according to the SLD) and deactivated any options like header and attachment.
    Upon facing the above response I also tried any kind of derivative with inserting the described tag/attribute/element versionMajor, but to no avail.
    My questions are:
    What do I have to do additionally to get the whole thing running, i.e. configure my external systems in the SLD, providing proxy settings?
    Do I have to create web services within the Web AS (which provide some kind of facade to the XI engine using the proxy generation) and connect to these instead of directly addressing the integration engine (I'm using the URL http://<host>:<port>/sap/xi/engine?type=entry, but I also tried http://<host>:<port>/XISOAPAdapter/MessageServlet?channel=:SOAPRequest:SOAPIn, this led to a 404 not found error)?
    What settings do I have to provide to see the messages the client is sending, when looking into the runtime workbench it seems as if there are no messages at all - at least from my client?
    Hopefully somebody might help me out or least provide some information to get me going.
    Thanks in advance.
    Best regards,
    T.Hrastnik

    Hello Oliver,
    all information I gathered so far derives from the online help for XI 3.0, to be found under http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm. There You'll find - in the last quarter of the navigation bar on the left side - sections describing the adapter engine alonside the SOAP adapter.
    Additionally I went through almost all postings in this forum.
    This alonside the mandatory trial-and-error approach (I did a lot of it up to date) led me to my current status, i.e. so far I haven't found any kind of (simple) tutorial or demo saying "If You want to establish a web service based connection via SOAP between external applications and XI first do this, then that ...", sadly enough :-(.
    Hope that helps, any questions are always welcome, I'll try my best to answer them ;-).
    Best regards,
    Tomaz

  • How to call ABAP function module/ class method through web service?

    Hi Colleagues,
    I need to write an iphone version of current ABAP program. I want to call ABAP method and function module through my iphone so that I can re-use the ABAP APIs.So I choose web service. Can you give me any details information about how to do that?
    Thank you very much

    Hi,
    you need to create webservice out of FM. goto SE80 and follow the webservice creation wizard. Finally use webservice url for calling FM (remote enabled) from your iPhone.
    Regards,
    Gourav

  • How to call a text FTP proxy service from a Java client ?

    Greetings,
    I've configured a text FTP proxy service which downloads files from a FTP server. It pols a directory on the FTP server and, as soon as a file respecting a given pattern apears it is downloaded. I tested the service in the test console and by putting some test files onto the FTP server. Now, I need to be able to test it from a Java client. How may I do that ? I need to write a Java client to connect to the OSB and to tell to it to use the FTP proxy in order to download a given file, from a given location and to put it in a given location on the client machine. Many thanks in advance for any help. A sample would be great !
    Kind regards,
    Nicolas

    Ok, I understand. The crucial question here is "what is a caller that you refer to?"
    Don't get me wrong, but the problem here is that you probably don't understand, what OSB is good for. OSB is an event-driven system. The event in your case is a new message in remote FTP server. You have to define what should happen when that event is fired. And that's all. You don't have to involve other client (or caller) for this case.
    You should define your FTP proxy to retrieve all relevant files from FTP server and then you should route them based on their name/content/encoding/whatever to different consumers. You can also have many proxies if you want - one for each name. It's up to you. But you don't have any "callers" in either case.

  • Problem in writing a client web service from WSDL document

    Hi,
    I wrote a web service using .Net and a WSDL document. I tried after that to generate a client web service using Jdeveloper. but, the methode generated by Jdeveloper (in the stub) does not represente the original methode.
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <!--Generated by the Oracle9i JDeveloper Web Services WSDL Generator-->
    <!--Date Created: Fri Aug 09 13:59:52 EDT 2002-->
    <definitions
    name="CreditCard"
    targetNamespace="http://tempuri.org/jdeveloper/generated/CreditCard/CreditCard"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:tns="http://tempuri.org/jdeveloper/generated/CreditCard/CreditCard"
    xmlns:ns1="http://tempuri.org/jdeveloper/generated/CreditCard/CreditCard/schema">
    <types>
    <schema
    targetNamespace="http://tempuri.org/jdeveloper/generated/CreditCard/CreditCard/schema"
    xmlns="http://www.w3.org/2001/XMLSchema"
    xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"/>
    </types>
    <message name="Validate0Request">
    <part name="cardNumber" type="xsd:string"/>
    <part name="lngDate" type="xsd:long"/>
    </message>
    <message name="Validate0Response">
    <part name="return" type="xsd:boolean"/>
    </message>
    <portType name="CreditCardPortType">
    <operation name="Validate">
    <input name="Validate0Request" message="tns:Validate0Request"/>
    <output name="Validate0Response" message="tns:Validate0Response"/>
    </operation>
    </portType>
    <binding name="CreditCardBinding" type="tns:CreditCardPortType">
    <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
    <operation name="Validate">
    <soap:operation soapAction="" style="rpc"/>
    <input name="Validate0Request">
    <soap:body use="encoded" namespace="CreditCard.CreditCard" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
    </input>
    <output name="Validate0Response">
    <soap:body use="encoded" namespace="CreditCard.CreditCard" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
    </output>
    </operation>
    </binding>
    <service name="CreditCard">
    <port name="CreditCardPort" binding="tns:CreditCardBinding">
    <soap:address location="http://localhost:8888/FirstSample-CreditCard-context-root/CreditCard.CreditCard"/>
    </port>
    </service>
    </definitions>
    Here The methode Validate consume two parameters : string and long
    the generated stub look like :
    public Vector Validate(Element requestElem) throws Exception
    There is some one who have a solution ?
    ---------------------------------------

    My guess is that it is because .NET defaults to generating a document style interface whereas JDeveloper defaults to generating an RPC style interface. The end result is that JDeveloper wraps the document interface in something that looks document like - thus your client. To see how to handle this right now, check out this sample - you have to parse the XML:
    http://otn.oracle.com/tech/webservices/htdocs/series/net/content.html
    In the preview of JDeveloper 9.0.3 which is due quite soon - next few weeks roughly (crossing my fingers) - JDeveloper will wrap .NET document based Web services in a much more elegant wrapper - giving you exactly what you are looking for - a method called Validate rather than a vector of Elements.
    What I don't understand in your sample, however, is that you have WSDL generated from JDeveloper versus WSDL generated from .NET. Did you also do an implementation of the validate method in Java too?
    Mike.

  • Calling a servlet from a Java Stored Procedure

    Hey,
    I'm trying to call a servlet from a Java Stored Procedure and I get an error.
    When I try to call the JSP-class from a main-method, everything works perfectly.
    Java Stored Procedure:
    public static void callServlet() {
    try {
    String servletURL = "http://127.0.0.1:7001/servletname";
    URL url = new URL(servletURL);
    HttpURLConnection conn = (HttpURLConnection)url.openConnection();
    conn.setDoOutput(true);
    conn.setRequestProperty("Pragma", "no-cache");
    conn.connect();
    ObjectInputStream ois = new ObjectInputStream(conn.getInputStream());
    Integer client = (Integer)ois.readObject();
    ois.close();
    System.out.println(client);
    conn.disconnect();
    } catch (Exception e) {
    e.printStackTrace();
    Servlet:
    public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    Integer id = new Integer(10);
    OutputStream os = response.getOutputStream();
    ObjectOutputStream oos = new ObjectOutputStream(os);
    oos.writeObject(id);
    oos.flush();
    oos.close();
    response.setStatus(0);
    Grant:
    call dbms_java.grant_permission( 'JAVA_USER', 'SYS:java.net.SocketPermission','localhost', 'resolve');
    call dbms_java.grant_permission( 'JAVA_USER','SYS:java.net.SocketPermission', '127.0.0.1:7001', 'connect,resolve');
    Package:
    CREATE OR REPLACE PACKAGE pck_jsp AS
    PROCEDURE callServlet();
    END pck_jsp;
    CREATE OR REPLACE PACKAGE BODY pck_jsp AS
    PROCEDURE callServlet()
    AS LANGUAGE JAVA
    NAME 'JSP.callServlet()';
    END pck_jsp;
    Architecture:
    AS: BEA WebLogic 8.1.2
    DB: Oracle 9i DB 2.0.4
    Exception:
    java.io.StreamCorruptedException: InputStream does not contain a serialized object
    at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java)
    at java.io.ObjectInputStream.<init>(ObjectInputStream.java)
    The Servlet and the class work together perfectly, only when I make the call from
    within the database things go wrong.
    Can anybody help me.
    Thank in advance,
    Bart Laeremans
    ... Desperately seeking knowledge ...

    Look at HttpCallout.java in the following code sample
    http://www.oracle.com/technology/sample_code/tech/java/jsp/samples/jwcache/Readme.html
    Kuassi

  • How to call IAC Iview from WebDynpro java code

    Hi Team,
    I am tring to call IAC Iview from WebDynpro Java code. we are passing value but blank page  displayed and there is no error show on error log.
    Below is Java Code which i am calling.
      public void wdDoInit()
          try {
                String strURL = "portal_content/TestSRM/iView/TestSRM";                           //WDProtocolAdapter.getProtocolAdapter().getRequestParameter("application");
                 String random = WDProtocolAdapter.getProtocolAdapter().getRequestObject().getParameter("random_code");     
                 //wdContext.currentContextElement().setRandomNumber(random);
    //below we are call URL           
    WDPortalNavigation.navigateAbsolute("ROLES://portal_content/TestSRM/iView/TestSRM?VAL="+random,WDPortalNavigationMode.SHOW_INPLACE,(String)null, (String)null,
                       WDPortalNavigationHistoryMode.NO_DUPLICATIONS,(String)null,(String)null, " ");
            } catch (Exception e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
    I am passing value from URL.
    http://<host Name>:<port>/webdynpro/resources/local/staruser/StarUser?random_code=111111111
    when we call above URL we getting blank screen.
    Regards
    Pankaj Kamble

    Hi Vinod,
    read this document (from pages 7 ).
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/b5380089-0c01-0010-22ae-bd9fa40ddc62">https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/b5380089-0c01-0010-22ae-bd9fa40ddc62</a>
    In addition lok at these links: (Navigation Between Web Dynpro Applications in the Portal)
    <a href="http://help.sap.com/saphelp_erp2005/helpdata/en/ae/36d93f130f9115e10000000a155106/frameset.htm">http://help.sap.com/saphelp_erp2005/helpdata/en/ae/36d93f130f9115e10000000a155106/frameset.htm</a>
    <a href="http://help.sap.com/saphelp_erp2004/helpdata/en/b5/424f9c88970f48ba918ad68af9a656/frameset.htm">http://help.sap.com/saphelp_erp2004/helpdata/en/b5/424f9c88970f48ba918ad68af9a656/frameset.htm</a>
    It may be helpful for you.
    Best regards,
    Gianluca Barile

  • Looking up EJBs from a java client

    While trying to migrate my application from standalone-oc4j
    to Oracle Application Server 10g, I ran into the following problem.
    My application has a stateless session bean. When trying to lookup the bean (from a java client), I get the following exception:
    javax.naming.NamingException: Lookup error: javax.naming.AuthenticationException
    Invalid username/password for UnifyoccEAR (ias_admin)
    My code used the username/password I used to log into web-based console (which I used to deploy the application). The lookup code follows:
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY,
    OracleJASLayer.INITIAL_CONTEXT_FACTORY);
    env.put(Context.PROVIDER_URL, "ormi://localhost:3201/UnifyoccEAR");
    env.put(Context.SECURITY_AUTHENTICATION, "simple");
    env.put(Context.SECURITY_PRINCIPAL, username);
    env.put(Context.SECURITY_CREDENTIALS, password);
    Context ctx = new InitialContext(env);
    Object obj = ctx.lookup("unify/nxj/controlCenters/occ/ControlCenterEJB");
    On a whim, I tried the old SCOTT/TIGER username/password and got the following
    exception:
    javax.naming.NoPermissionException: Not allowed to look up unify/nxj/controlCenters/occ/ControlCenterEJB,
    check the namespace-access tag setting in orion-application.xml for details
    So evidently, SCOTT/TIGER is in the security database used by the app (but isn't
    authorized) while the ias_admin user is not in the security database.
    I have the following questions:
    1. In the default configuration, is there a username/password I can use to
    lookup EJB homes in the jndi namespace of an OC4J instance? If so, what
    is it?
    2. Where is the security database? I tried looking in the web-based console
    to find how to configure security and could not figure it out. I did find
    the Security page for the application, but when I tried to add a user,
    it had no effect. Furthermore, this page did not show a user entry for
    SCOTT; hence, it doesn't seem that OC4J is actually using the information
    on this page. This is strange because the path to this page is:
    Farm > Application Server: ias_admin.lab10.sac.unify.com > OC4J: home > Application: UnifyoccEAR > Security
    I then went to the Security page for the default application and found
    that it did have a SCOTT user. So I added a new user and tried to run
    my java client. This resulted in the javax.naming.AuthenticationException
    described above (I was expected the NoPermissionException encounted when
    using SCOTT/TIGER). Next, I used the Security page for the default application
    to change the password for SCOTT and reran my java client using SCOTT/TIGER.
    This time I was expecting an AuthenticationException exception, but got the
    NoPermission exception. Therefore, it seems that OC4J isn't using this
    security data either.
    Hunting in the console (again) for the security database, I stumble accross
    the Infrasturcture page and see an Identity Management section and see that
    it is configure to use an Oracle Internet Directory server. Using
    <ORACLE_HOME>/bin/oidadmin, I connect to the directory server and look
    for the SCOTT user. I don't find it, so I believe that this can't be the
    security database either.
    3. Finally, how do I configure the OC4J instance such that it will allow
    anonymous users to lookup my EJB from a java client?
    Please help a confused and frustrated user.

    Looking at your example, it looks like you are using a J2EE client container or some properties file to specify the JNDI environment used to create the initial context (for you use the no-arg constructor to InitialContext). Since our application needs to the ability to dynamically connect to ejb's running on different Java application servers (e.g., WebLogic, WebSphere, JBoss), such an approach will not work. Instead we must do it the old-fashioned way and pass the jdni connection info to the InitialContext constructor.
    In any event, our problem isn't how to write the connection code, it is how to test it. Specifically, we can't figure out a valid username/password that will allow us to look up the home. Nor can we figure out how to configure security for the oc4j instance.

  • How to invoke a proxy service from a java client

    Hi all,
    how could I invoke a proxy service from a java client ?
    The proxy service type is 'any xml service' with http protocol.
    For a proxy with web service type I can export the related WSDL and generate the java client source.
    With 'any xml service' there is no associated wsdl and I'm wondering how to do that.
    Thanks
    ferp

    Hi Ferp,
    I used ClientGEN to generate client files from WSDL deployed in ALSB. You can also use Axis for client file generation.
    You need to know the WSDL URL. Generate Client files from WSDL URL.
    Sample ANT Script
    <project name="simple-web" default="mytask" basedir=".">
    <taskdef name="clientgen" classname="weblogic.wsee.tools.anttasks.ClientGenTask" classpath="C:\bea92\weblogic92\server\lib\weblogic.jar"/>
    <target name="mytask" description="Generate web service client">
              <clientgen wsdl="http://<hostname>:<port>/URL?WSDL"
         destDir="src"
         packageName="com.client.mytask"
         classpath="${java.class.path}" />
         </target>
    </project>
    Use the following JAVA Code,
    try {
         ActivationService service = new ActivationService_Impl("http://<hostname>:<port>/url?WSDL");
    client = service.getActivationServicePort();
    } catch (Exception ex) {
    // Handle Exception
    client.activateNumber();
    Let me know if you need any more information.
    Thanks,
    Suman.

  • Creating initial context from a java client

    I have tried to create intial context from a java client.....
    but that gives me the following exception:
    My code:TestClient.java
    import java.util.*;
    import javax.naming.*;
    public class TestClient
    public static void main(String nilesh[]) throws NamingException
    Hashtable hash = new Hashtable();
    hash.put("Context.INITIAL_CONEXT_FACTORY","com.evermind.server.rmi.RMIInitialContextFactory");
    hash.put("Context.PROVIDER_URL","ormi://localhost:23791/symularity");
    hash.put("Context.SECURITY_PRINCIPAL","admin");
    hash.put("Context.SECURITY_CREDENTIALS","admin");
    Context ctx = new InitialContext(hash);
    System.out.println("Context: "+ctx);
    The output is:
    ERROR! Shared library ioser12 could not be found.
    Exception in thread "main" javax.naming.NamingException: Error accessing repository: Cannot con
    nect to ORB
    at com.sun.enterprise.naming.EJBCtx.<init>(EJBCtx.java:51)
    at com.sun.enterprise.naming.EJBInitialContextFactory.getInitialContext(EJBInitialConte
    xtFactory.java:62)
    at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
    at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
    at javax.naming.InitialContext.init(Unknown Source)
    at javax.naming.InitialContext.<init>(Unknown Source)
    at TestClient.main(TestClient.java:14)
    is anybody able to solve my problem....
    Thanks in advance..
    NileshG

    Nilesh,
    First of all make sure that the shared library error you are getting is fixed by including the library in your classpath. Secondly, where are you running the client from? The connection factory that you use varies depending on where you are connecting from:
    1. ApplicationClientContextFactory is used when looking up remote objects from standalone application clients. This uses refs and mappings in application-client.xml.
    2. RMInitialContextFactory is used when looking up remote objects between different containers.
    3. ApplicationInitalContextFactory is used when looking up remote objects in same application. This is the default initial context factory and this uses refs/mappings in web.xml and ejb-jar.xml.
    Rob Cole
    Oracle Hello Rob cole..
    thank u for ur reply...but actualy i dont know what is application-client.xml and where i can find that file in my j2ee folder...can u give me detail explanation about that...actually i have not created any application or not deployed also without deploying any application i have created that TestClient.java class so how it will relate with application-client.xml....so i have changed the lookup code with ApplicaitonClientContextFactory...but still the same error is coming......can u give me the full explanation or solution of my problem...
    Thanks & Regards
    NileshG...

  • How to call a BAPI from Visual Composer

    hi,
       I am new to Visual composer. can some body give me step by step information of calling a bapi or RFC from VC.
    Thanks in advance,
    Gopi

    Hi Gopi,
    Steps involed for calling RFC/BAPI from VC
    1. Choose Model->Select Data Services.
    (Alternatively, click the Data button in the task panel toolbar.)
    2. In the Portal field at the right end of the main toolbar, enter the URL of the portal from
    which you can access the back-end system used by the iView.
    For example, you could enter: http://<yourportal>:50000/..
    3. Click the traffic light icon to the right of the Portal field. The portal Welcome screen
    appears.
    4. Log on to the portal as a user that exists in the connected back-end system, or which is
    mapped to a user of that system. Click OK.
    Once a connection to the portal is established, a list of system aliases defined in the
    portal system landscape appears in the System drop-down
    list.
    From the System drop-down list, choose the SAP system that contains the function module.
    6. Under Search SAP System, click the Search tab and in the Name field, enter the search string: <RFC/BAPI name>. Then click Search (at the bottom).
    5. A list of function modules matching the search string is displayed.
    7. Drag the function module/bapi from the Data task panel into the
    workspace: The data service is added to your model.
    8. Periodically save your work. To do so, choose File->Save Model.
    Finally test the iview in VC.
    In the workspace, drag your mouse from the Input port of the data service, <inputform> and dragn your mouse from the outut port from the data service <tabelview and etc..>
    or
    Go through the this documentation...
    http://help.sap.com/download/netweaver/nw04/visualcomposer/VC_60_UserGuide_v1_1.pdf
    Thanks,
    Suriya.

Maybe you are looking for

  • IPad app won't download and can't delete it

    An iPad app I have previously installed had an update which I went to install as usual.  The download  is stalled on "waiting" and won't progress.  I can't delete the app because when I hold it down it wiggles but the "delete x" won't show.  The App

  • Solaris patching on solaris 10 x86

    just wondering if anyone can assist. i have just installed solaris 10 x86 recommended patches on a 16 disks server. where first 2 disks are mirrored called rpool, and remaining 14 disks are raid z called spool. upon installing the patches successfull

  • Email count not displaying in iOS 8.0.2

    So immediately after upgrading to iOS 8.0.2 my email count stopped showing up on the screens icon. I've tried restarting and deleting my email accounts and adding them back and nothing changes. Anyone else experiencing this?

  • Status QM* for a work order from FM: STATUS_READ_MULTI.

    Hi All We are calling the function module CALL FUNCTION 'STATUS_READ_MULTI'      EXPORTING        client                     = sy-mandt        only_active                = 'X'        all_in_buffer              = 'X' *     GET_CHANGE_DOCUMENTS       =

  • Communities application error

    I downloaded the Communities Beta app because it was recommended when I went to the Facebook website. When I try to log in to Twitter and Facebook, there's a message: Error: The client failed to connect to the gateway. How do I fix this? Or is it a p