EJB calling SOAP service

I'm experiencing a problem on 61.sp3.
I have an EJB that utilizes an API toolkit to access SOAP services on a
Tomcat server. The SOAP service sends back a SOAP exception which is
correct in what I am asking
in to do. However, the weblogic app server is returning a SOAP
exception to my EJB rather than passing the SOAP exception to the API
toolkit that I am using to make my SOAP calls.
Has anyone seen something like this?
Sandy Mustard

I did it (wsdl2java).
But I am working with jaxrpc.jar and axis.jar.
What my EJB does is:
java.xl.rpcCall call;
try {
    java.xl.rpc.ServiceFactory serviceFactory = java.xl.rpcServiceFactory.newInstance();
    Service service = serviceFactory.createService(new QName("", "hello"));
    QName qName = new QName("http://www.w3.org/2001/XMLSchema", "Array");
    TypeMapping service.getTypeMappingRegistry().getDefaultTypeMapping();
    typeMapping.register(ArrayList.class, qName,
                        new ArraySerializerFactory(),
                        new ArrayDeserializerFactory());
    call = service.createCall();
    } catch (ServiceException e) {
        cat.error(e.printStackTrace());
    try {
        call.setTargetEndpointAddress("http:/localhost:81");
    } catch (JAXRPCException e) {
        cat.error(e.printStackTrace());
    call.setProperty(Call.SESSION_MAINTAIN_PROPERTY, Boolean.TRUE);
    call.setProperty(Call.SOAPACTION_USE_PROPERTY, Boolean.TRUE);
    call.setOperationName(new QName("", "hello"));
    try {
        return call.invoke(new Object[]{});
    } catch (RemoteException e1) {
        cat.error(e.printStackTrace());
    }Now I have another error which varies, it's quite disturbing me.
It goes from 'NoClassDefFound' to 'Linkage' errors...
Unexpected Error:
java.lang.NoClassDefFoundError: javax/xml/rpc/encoding/TypeMapping
and
Unexpected Error:
java.lang.LinkageError: loader constraints violated when linking javax/xml/rpc/encoding/SerializerFactory class
I get similar errors if I force the serviceFactory to be an instance of org.apache.axis.client.ServiceFactory.
Apparently I cannot make such remote calls within an only thread (?)
GNeidisch

Similar Messages

  • Need help calling SOAP service deploy in WebLogic

    Hi bros & sisters,
    My name is veda.
    Need some help in calling a SOAP binding web service deploy in Weblogic, using classic ASP
    After reading this link http://www.aspfree.com/c/a/ASP/Consuming-a-WSDL-Webservice-from-ASP/,
    1. i still do not know what value to pass in for parameter SoapURL. I did try http://invicta.app.vic:8002/RTO/RTOService/getCustomerOffers, but return a negative result.
    2. Am i right to say i cannot do a SoapRequest.Open "GET",
    or SoapRequest.Open "POST", because i only have a SOAP protocol binding instead of HTTP protocol binding.
    I really appreciate any help to enlighten me.
    Below is my complete wsdl. Its quite a small wsdl
      <?xml version="1.0" encoding="utf-8" ?>
    - <definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://com.gtr.ma.rto/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://com.gtr.ma.rto/" name="RTOService">
    - <types>
    - <xsd:schema>
      <xsd:import namespace="http://com.gtr.ma.rto/jws" schemaLocation="http://invicta.app.vic:8002/RTO/RTOService?xsd=1" />
      </xsd:schema>
    - <xsd:schema>
      <xsd:import namespace="http://api.interact.coycorp.com/xsd" schemaLocation="http://invicta.app.vic:8002/RTO/RTOService?xsd=2" />
      </xsd:schema>
      </types>
    - <message name="getCustomerOffers">
      <part xmlns:ns1="http://com.gtr.ma.rto/jws" name="parameters" element="ns1:getCustomerOffers" />
      </message>
    - <message name="getCustomerOffersResponse">
      <part xmlns:ns2="http://com.gtr.ma.rto/jws" name="parameters" element="ns2:getOffersResponse" />
      </message>
    - <message name="endCustomerSession">
      <part xmlns:ns3="http://com.gtr.ma.rto/jws" name="parameters" element="ns3:endCustomerSession" />
      </message>
    - <message name="endCustomerSessionResponse">
      <part xmlns:ns4="http://com.gtr.ma.rto/jws" name="parameters" element="ns4:endCustomerSessionResponse" />
      </message>
    - <portType name="RTOImpl">
    - <operation name="getCustomerOffers">
      <input message="tns:getCustomerOffers" />
      <output message="tns:getCustomerOffersResponse" />
      </operation>
    + <operation name="endCustomerSession">
      <input message="tns:endCustomerSession" />
      <output message="tns:endCustomerSessionResponse" />
      </operation>
      </portType>
    - <binding name="RTOImplPortBinding" type="tns:RTOImpl">
      <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
    - <operation name="getCustomerOffers">
      <soap:operation soapAction="" />
    - <input>
      <soap:body use="literal" />
      </input>
    - <output>
      <soap:body use="literal" />
      </output>
      </operation>
    - <operation name="endCustomerSession">
      <soap:operation soapAction="" />
    - <input>
      <soap:body use="literal" />
      </input>
    - <output>
      <soap:body use="literal" />
      </output>
      </operation>
      </binding>
    - <service name="RTOService">
    - <port name="RTOImplPort" binding="tns:RTOImplPortBinding">
      <soap:address location="http://invicta.app.vic:8002/RTO/RTOService" />
      </port>
      </service>
      </definitions>

    Use a proper Java web service client stack that will make your life easier.

  • Adding WS Security in SOAP header for calling soap services from PI

    When i am calling a wss enabled webservice from soapui with the header parameters
    Username , Password and Password Type - PasswordText , it is able to get results. The soapui tool automatically adds the following in the soap header -
         <wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
             <wsse:UsernameToken wsu:Id="UsernameToken-9368150" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
                <wsse:Username>xxxxx</wsse:Username>
                <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">xxxxx</wsse:Password>
                <wsse:Nonce>aOA1P6t2hJPRyuraQ/IliQ==</wsse:Nonce>
                <wsu:Created>2009-07-10T14:58:33.781Z</wsu:Created>
             </wsse:UsernameToken>
          </wsse:Security>
    However , in PI when the following configurations are made -
    Web Services Security option selected in soap receiver adapter
    In Receiver Agrrement -
    Security Standard -  http://docs.oasis ....
    Security Procedure (Request) - None
    Security Procedure (response) - None
    the user tokens don't seem to generated and it is giving an authentication error . Is there any process of generating this in the outgoing soap header from PI.
    SOAP Axis framework is not installed at present  and working on PI 7.1 SP6.
    Looking forward for your replies

    same issue for me too.
    Try using WS adapter on receiver side .
    If you are able to attach SOAP header with WSSE fields using SOAP adapter at reciever channel let me know how you did it.

  • EJB call Portal Service

    Hi everyone,
    I created a portal service and deployed it to the J2EE server.
    I also created an EJB and deployed it on the same J2EE server.
    Is it possible that the EJB can use the Portal Service ?
    Thanks.

    David,
    Actually, I just found a document that might be helpful. Please check if <a href="http://help.sap.com/saphelp_nw04s/helpdata/en/42/9ddd0cbb211d72e10000000a1553f6/frameset.htm">this</a> fits into your scenario.
    Best regards,
    Vladimir

  • How do i call web services from SAP ABAP

    Hello,
    Ian working with .net team. they are using sap .net Connector to connect SAP. But my job is In SAP side when Purchase Requisition is created, I have to call web services from ABAP and i have to pass the Purchase Requisition number to web service(.net Program). Please help me how to call web services from ABAP and how to pass value. Any one help me with example.
    Thanks
    RaviKumar

    Hi Ravi,
    If you can call EJB from ABAP and from EJB call Web service which you want to call. I am giving code to write in EJB business method processFunction.
    public void processFunction(Function function) {
       IRepository repository;
       repository = new Repository("TestRepository");
       JCO.MetaData fmeta = new JCO.MetaData("ZTEST_EJB");
       fmeta.addInfo("REQUTEXT", JCO.TYPE_CHAR, 255,   0,  0,  
       JCO.IMPORT_PARAMETER, null);
       fmeta.addInfo("ECHOTEXT", JCO.TYPE_CHAR, 255,   0,  0,
       JCO.EXPORT_PARAMETER, null);
       fmeta.addInfo("RESPTEXT", JCO.TYPE_CHAR, 255,   0,  0,
       JCO.EXPORT_PARAMETER, null);
       repository.addFunctionInterfaceToCache(fmeta);
       JCO.ParameterList input  =
       function.getImportParameterList();
       JCO.ParameterList output =
       function.getExportParameterList();          
       JCO.ParameterList tables =
       function.getTableParameterList();
      if (function.getName().equals("ZTEST_EJB")) {
                        output.setValue(input.getCharArray("REQUTEXT"),"ECHOTEXT");
    output.setValue("This is a response " + table.getString("E_NAME") +" " + output.getName(1), "RESPTEXT");
      else if (function.getName().equals("STFC_STRUCTURE")) {
      JCO.Structure sin  = input.getStructure("IMPORTSTRUCT");
      JCO.Structure sout = (JCO.Structure)sin.clone();
      try {
          System.out.println(sin);
       catch (Exception ex) {
           System.out.println(ex);
                        output.setValue(sout,"ECHOSTRUCT");
    output.setValue("This is a response from Example5.java","RESPTEXT");
    }//if
    Here REQUTEXT, ECHOTEXT are import parameter and RESPTEXT is the Export parameter of Function module ZTEST_EJB in SAP.
    Here from this bisuness method you can call web service which you want and give back the result of webservice to ABAP F.M.
    Regards,
    Bhavik

  • How to deal with complex SOAP responses when calling web services ???

    Hi all,
    I have an issue when calling a web service that returns a complex
    SOAP response message. With simple responses (e. g. array of strings) it
    worked.
    I created the PDF as an Interactive form with Livecycle Designer 8.2.
    The Javascript looks like this:
    var cURL = "http://blabla";
    var cTestString = "too";
    SOAP.wireDump=true;
    var response = SOAP.request(
         cURL: cURL,
         oRequest: {
              "http://blabla.com/:complete" : {
              arg0: cTestString
              cAction: "http://bla.com:50000/"
    var resp = response["http://blabla.com:serviceResponse"];
    console.println("lenght:"+resp.length);
    var myns = "http://blabla.com/namespace";
    for (var nItem in resp.return)
      console.println("" + nItem + " " + resp.return[nItem] );
         for (var ConceptView in resp.return[nItem])
           console.println("  "+resp.return[nItem].length);
           console.println("  "+ConceptView+" "+resp.return[nItem][ConceptView] );
           if (ConceptView == myns + ":Response")
              for (var item2 in resp.return[nItem][ConceptView]){
                  console.println("    "+item2+" "+resp.return[nItem][ConceptView][item2] );
    I call the service and when I realized that I do not find out the type of the object returned, I used the nested for-in-loops to iterate through it. But it seems that there is just one item in the Javascript object returned, although the SOAP message clearly shows that there are more than one item.
    Can you help me?
    One key problem when analyzing this issue is that I do not know at all
    the Javascript type of response. We suspected it might be an array, but it is not
    because the method .length returns "undefined". It would already be
    helpful to know at least the type of this object and to know callable
    methods and so on ...
    Best regards
    Christoph
    P.S. As mentioned I used Livecycle Designer 8.2 and displayed and
    debugged the document using Acrobat 9.

    Christoph,
    Firstly LiveCycle Designer 8.2 is still not supported to develop forms as per my knowledge. The latest version compatible for SAP Interactive Forms is ALD 8.0.
    There is a difference between Acrobat based forms and LiveCycle forms and based on your coding it looks to me  that you are trying to create a LiveCycle based form with coding of Acrobat which is not supported in LiveCycle Desginer, which is why you may be getting the error.
    I hope that does not confuse you, so may check this [link|http://www.acrobatusers.com/articles/2006/08/designer_or_forms/index.php] for some clear information on what point I was trying to make.
    Chintan

  • Blank SOAP Action in Soap Request- Portal Service calling Web Service

    Hi
    I'm trying to access an Web Service through a client portal service which was generated by NWDS. I called this service from a basic component and tried to execute the WS function after populating all the needed fields. When I started the component I encountered the following error.
    java.lang.IllegalArgumentException: The SOAP Action "" include in the soap request not corresponding to the Portal service method..
    I initially thought it was because I was downloading the WSDL to my local and using that in the portal service generation. Maybe not all the information about the web service was being obtained. I tried it again after generating the portal service from the WSDL online but still obtained the same error.
    Any insight on what's causing the error would be appreciated. Thanks!

    Dear expert.
    i got the same problem with Reyes. anyone can solve this issue?
    thank in advance.

  • Calling SOAP Web Service in dynpro?

    Hello,
    I have configured the XI to exchange data from an external soap and exposed its web service through wsdl file. Now I want to call the service in my model for dynpro application but when I define the adaptive web service model it gives me error but returns status code 200.
    Can I call the XI service directly using Java Code, I would be thankful if you guide me how establish the dynpro and XI web service communication.
    regards,
    Jawed Ali

    Thats what my problem is Murtuza. I have created the adaptive webservice model as I am using latest version of the EP and NWDS. The plain Web service model is now deprecated, so I have to model the XI webservice using adaptive web service model.
    The deprecated web service model, used to provide some proxy classes generation mechanism which the new adaptive model doesn't provide. I have tested my XI webservice WSDL file using XML Spy and its giving me correct output but the adaptive webservice model gives me the error, which I described in my first post.
    I hope I have cleared my point, if you need any thing else to know let me know.
    I created and deployed the web service proxy client and trying to call it using the java code but it also gives me ClassCastException when executing following code to call XI webservice using webservice client proxies:
         InitialContext ctx = new InitialContext();
         Object obj = ctx.lookup("/wsclients/proxies/sap.com/PBWSProxy/com.pso.prototype.PBWSXIProxy");
         sResult = obj.getClass().toString();
         MI_CHK_ACC_OUTService service = (MI_CHK_ACC_OUTService) obj;
         MI_CHK_ACC_OUT stub = (MI_CHK_ACC_OUT)service.getLogicalPort();
         stub._setProperty("javax.xml.rpc.security.auth.username", "pisuper");
         stub._setProperty("javax.xml.rpc.security.auth.password", "lotus123");
         sResult=stub.MI_CHK_ACC_OUT("0000104851", "1100");               
    line:
    <b>MI_CHK_ACC_OUTService service = (MI_CHK_ACC_OUTService)</b> obj;, throwing exception after debuggin I found MI_CHK_ACC_OUTServiceImpl file the code is looking for but I don't have any definition for this class, as the proxy I created doesn't provide any such class. Any idea from where I can find the class definition for MI_CHK_ACC_OUTServiceImpl?

  • Call authenticate service in EJB

    Hi Experts
    I'd developed a ejb project, and in this project i imported a service from esworkplace. I need to authenticate when i call this service, but i don't know how can i do this. I think is necessary http authentication.
    I created a service group, but didn't work.
    I use NW 7.1 EHP1.
    Someone can help me to resolve this?
    Marcos
    Edited by: Marcos Brandao on Jun 23, 2009 6:21 PM

    Hi Alka
    Thanks for your reply
    I've done this, but the error is happen.
    This is my code:
    ((BindingProvider) port).getRequestContext().put(BindingProvider.USERNAME_PROPERTY,"S000XXXXXXX");
    ((BindingProvider) port).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY,"XXXXXXXXXXXXX");
    and the message error returned:
    javax.ejb.EJBException: (Failed in component: xxxx.com.br/crvp~ear~services)
    Exception raised from invocation of public br.com.xxxxxxxxx.xi.apo.global.ResourceSimpleByPlantResponseSync br.com.xxxxxxxxx.xi.apo.global.QueryCriticalResourceInImplBean.findCriticalResourceByPlant(br.com.xxxxxxxxx.xi.apo.global.ResourceSimpleByPlantQuerySync)
    throws br.com.xxxxxxxxx.xi.apo.global.StandardMessageFault_Exception method on bean instance [email protected]da952
    for bean xxxx.com.br/crvp~ear~services*annotation|xxxx.com.br~crvp~ejb~services.jar*annotation|QueryCriticalResourceInImplBean
    in application xxxx.com.br/crvp~ear~services.; nested exception is: javax.xml.ws.WebServiceException:
    Invalid Response code (401). Server <http://erp.esworkplace.sap.com/sap/bc/srt/xip/sap/ecc_workcentre001qr/version2?sap-client=800> returned message <Unauthorized>.
    javax.xml.ws.WebServiceException: Invalid Response code (401).
    Server <http://erp.esworkplace.sap.com/sap/bc/srt/xip/sap/ecc_workcentre001qr/version2?sap-client=800> returned message <Unauthorized>.
    Maybe i forget some steps, i just don't put the ENDPOINT_ADDRESS_PROPERTY property in BindingProvider, but others examples don't have, and if i put, the errors continues.
    Any ideia?
    Regards
    Marcos

  • Referencing the version of the soap service in the WSDL call

    I'm wondering if you can call the version of the soap service in the wsdl call. That way you can have different sources using different version of the service.
    Cheers,

    Hi,
    Just for clarity, are you asking how to run a specific version of the same process?  It sounds like it.  If so, while what Jasmin said is correct, keep in mind that a WSDL that is returned only represents the service interface (i.e. inputs and outputs).  If your versions don't differ at the interface/endpoint the WSDL isn't going to help you with versioning.
    Basically, if you change the workflow/process but not the interface/endpoint the WSDL will look the same.  To the best of my knowledge when you make a call to the service/process LC uses the definition of the call (which is based on the WSDL) to run the right process version.   So, if you have services/processes that have the same WSDL definition even though there are multiple versions of the process, which one does it run?  I believe it runs the newest version.  This will create an interesting challenge to support legacy systems.
    I'm willing to admit that the above is my understanding from dealing with web services in general so maybe there is something extra to the way LC can handle calling a specific process when the interfaces are the same.  Or maybe I'm just completely wrong!
    Interested in confirmation on this myself.  Thanks!

  • Calling Web services using SOAP

    Hi,
    I am trying to execute a function through a webservice using a SOAP
    package and am getting the following error:ORA-30625: method dispatch
    on NULL SELF argument is disallowed. I think this is to do with one of
    the parameters being null but dont know how to fix this. Following is
    the function:
    CREATE OR REPLACE FUNCTION ILACPMSPRC.GET_GREETING_fnc (p_name IN
    VARCHAR2
    --, p_date VARCHAR2
    , p_age VARCHAR2 )
    RETURN NUMBER
    AS
    l_request soap_api_pkg.t_request;
    l_response soap_api_pkg.t_response;
    l_price NUMBER;
    -- DBMS_OUTPUT.ENABLE(20000);
    BEGIN
    DBMS_OUTPUT.ENABLE(20000);
    DBMS_OUTPUT.PUT_LINE('BEGIN');
    -- Set proxy details if no direct net connection.
    --UTL_HTTP.set_proxy('myproxy:4480', NULL);
    --UTL_HTTP.set_persistent_conn_support(TRUE);
    -- Set proxy authentication if necessary.
    --soap_api.set_proxy_authentication(p_username => 'myusername',
    -- p_password => 'mypassword');
    l_request := soap_api_pkg.new_request(p_method => 'ns1:validate',
    p_namespace => 'xmlns:ns1="http://
    impl.webservice.validation.workmgt.cb.irishlife.ie/xsd"');
    -- parameter 1 is name
    soap_api_pkg.add_parameter(p_request => l_request,
    p_name => 'workType',
    p_type => 'xsd:string',
    p_value => p_name);
    -- parameter 2 is date
    soap_api_pkg.add_parameter(p_request => l_request,
    p_name => 'workItemNo',
    p_type => 'xsd:string',
    p_value => 'ABC');
    --p_value   => '2007-01-01T00:00:00Z');
    -- parameter 3 is age
    soap_api_pkg.add_parameter(p_request => l_request,
    p_name => 'indexName',
    p_type => 'xsd:string',
    p_value => p_age);
    l_response := soap_api_pkg.invoke(p_request => l_request,
    p_url => 'http://
    10.253.55.139:7400/axis2/services/ValidationService',
    p_action => 'http://
    10.253.55.139:7400/axis2/services/ValidationService/validate');
    if l_response.doc is not null then
    dbms_output.put_line('the doc is not null');
    end if;
    DBMS_OUTPUT.PUT_LINE ( 'p_name = ' || p_name );
    HERE l_price := soap_api_pkg.get_return_value(p_response =>
    l_response,
    p_name =>
    'validateResponse',
    p_namespace =>
    'xmlns:ns1="http://impl.webservice.validation.workmgt.cb.irishlife.ie/
    xsd"');
    if l_price is null then
    dbms_output.put_line('opps, the price is null');
    end if;
    DBMS_OUTPUT.PUT_LINE('PRICE:'||l_price);
    RETURN l_price;
    EXCEPTION
    WHEN OTHERS THEN
    dbms_output.put_line(SQLCODE || ', ' || SQLERRM);
    RETURN NULL;
    END GET_GREETING_fnc;
    Where HERE is marked is where the problem lies...the package body is
    here:
    CREATE OR REPLACE PACKAGE BODY SOAP_API_PKG AS
    -- Name : http://www.oracle-base.com/dba/miscellaneous/soap_api
    -- Author : DR Timothy S Hall
    -- Description : SOAP related functions for consuming web services.
    -- Ammedments :
    -- When Who What
    -- =========== ========
    =================================================
    -- 04-OCT-2003 Tim Hall Initial Creation
    -- 23-FEB-2006 Tim Hall Parameterized the "soap" envelope tags.
    -- 08-JUN-2006 Tim Hall Add proxy authentication functionality.
    g_proxy_username VARCHAR2(50) := NULL;
    g_proxy_password VARCHAR2(50) := NULL;
    PROCEDURE set_proxy_authentication(p_username IN VARCHAR2,
    p_password IN VARCHAR2) AS
    BEGIN
    g_proxy_username := p_username;
    g_proxy_password := p_password;
    END;
    FUNCTION new_request(p_method IN VARCHAR2,
    p_namespace IN VARCHAR2,
    p_envelope_tag IN VARCHAR2 DEFAULT 'SOAP-ENV')
    RETURN t_request AS
    l_request t_request;
    BEGIN
    l_request.method := p_method;
    l_request.namespace := p_namespace;
    l_request.envelope_tag := p_envelope_tag;
    RETURN l_request;
    END;
    PROCEDURE add_parameter(p_request IN OUT NOCOPY t_request,
    p_name IN VARCHAR2,
    p_type IN VARCHAR2,
    p_value IN VARCHAR2) AS
    BEGIN
    p_request.body := p_request.body||'<'||p_name||' xsi:type="'||
    p_type||'">'||p_value||'</'||p_name||'>';
    DBMS_OUTPUT.PUT_LINE ( 'p_request.body = ' || p_request.body );
    END;
    --PROCEDURE add_parameter(p_request    IN OUT NOCOPY  t_request,
    -- p_name IN VARCHAR2,
    -- p_type IN DATE,
    -- p_value IN VARCHAR2) AS
    --BEGIN
    -- p_request.body := p_request.body||'<'||p_name||' xsi:type="'||
    p_type||'">'||p_value||'</'||p_name||'>';
    --END;
    --PROCEDURE add_parameter(p_request    IN OUT NOCOPY  t_request,
    -- p_name IN VARCHAR2,
    -- p_type IN INTEGER,
    -- p_value IN VARCHAR2) AS
    --BEGIN
    -- p_request.body := p_request.body||'<'||p_name||' xsi:type="'||
    p_type||'">'||p_value||'</'||p_name||'>';
    --END;
    PROCEDURE generate_envelope(p_request IN OUT NOCOPY t_request,
    p_env IN OUT NOCOPY VARCHAR2) AS
    BEGIN
    p_env := '<'||p_request.envelope_tag||':Envelope xmlns:'||
    p_request.envelope_tag||'="http://schemas.xmlsoap.org/soap/envelope/"
    ' ||
    'xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/1999/XMLSchema">' ||
    '<'||p_request.envelope_tag||':Body>' ||
    '<'||p_request.method||' '||p_request.namespace||' '||
    p_request.envelope_tag||':encodingStyle="http://schemas.xmlsoap.org/
    soap/encoding/">' ||
    p_request.body ||
    '</'||p_request.method||'>' ||
    '</'||p_request.envelope_tag||':Body>' ||
    '</'||p_request.envelope_tag||':Envelope>';
    END;
    PROCEDURE show_envelope(p_env IN VARCHAR2) AS
    i PLS_INTEGER;
    l_len PLS_INTEGER;
    BEGIN
    i := 1; l_len := LENGTH(p_env);
    WHILE (i <= l_len) LOOP
    DBMS_OUTPUT.put_line(SUBSTR(p_env, i, 60));
    i := i + 60;
    END LOOP;
    END;
    PROCEDURE check_fault(p_response IN OUT NOCOPY t_response) AS
    l_fault_node XMLTYPE;
    l_fault_code VARCHAR2(256);
    l_fault_string VARCHAR2(32767);
    BEGIN
    dbms_output.put_line('midas8-1');
    l_fault_node := p_response.doc.extract('/'||
    p_response.envelope_tag||':Fault',
    'xmlns:'||
    p_response.envelope_tag||'="http://schemas.xmlsoap.org/soap/
    envelope/');
    dbms_output.put_line('midas8-2');
    IF (l_fault_node IS NOT NULL) THEN
    dbms_output.put_line('midas8-3');
    l_fault_code := l_fault_node.extract('/'||
    p_response.envelope_tag||':Fault/faultcode/child::text()',
    'xmlns:'||
    p_response.envelope_tag||'="http://schemas.xmlsoap.org/soap/
    envelope/').getstringval();
    dbms_output.put_line('midas8-4');
    l_fault_string := l_fault_node.extract('/'||
    p_response.envelope_tag||':Fault/faultstring/child::text()',
    'xmlns:'||
    p_response.envelope_tag||'="http://schemas.xmlsoap.org/soap/
    envelope/').getstringval();
    dbms_output.put_line('midas8-5');
    --RAISE_APPLICATION_ERROR(-20000, l_fault_code || ' - ' ||
    l_fault_string);
    END IF;
    END;
    FUNCTION invoke(p_request IN OUT NOCOPY t_request,
    p_url IN VARCHAR2,
    p_action IN VARCHAR2)
    RETURN t_response AS
    l_envelope VARCHAR2(32767);
    l_http_request UTL_HTTP.req;
    l_http_response UTL_HTTP.resp;
    l_response t_response;
    BEGIN
    dbms_output.put_line('Invoking request');
    dbms_output.put_line('url :'||p_url);
    dbms_output.put_line('action :'|| p_action);
    generate_envelope(p_request, l_envelope);
    show_envelope(l_envelope);
    l_http_request := UTL_HTTP.begin_request(p_url, 'POST','HTTP/1.0');
    dbms_output.put_line('midas1');
    IF g_proxy_username IS NOT NULL THEN
    DBMS_OUTPUT.PUT_LINE('PROXY USERNAME IS NOT NULL');
    UTL_HTTP.set_authentication(r => l_http_request,
    username => g_proxy_username,
    password => g_proxy_password,
    scheme => 'Basic',
    for_proxy => TRUE);
    END IF;
    UTL_HTTP.set_header(l_http_request, 'Content-Type', 'text/xml');
    UTL_HTTP.set_header(l_http_request, 'Content-Length',
    LENGTH(l_envelope));
    UTL_HTTP.set_header(l_http_request, 'SOAPAction', p_action);
    UTL_HTTP.write_text(l_http_request, l_envelope);
    dbms_output.put_line('midas2');
    l_http_response := UTL_HTTP.get_response(l_http_request);
    dbms_output.put_line('midas3');
    UTL_HTTP.read_text(l_http_response, l_envelope);
    dbms_output.put_line('midas4');
    UTL_HTTP.end_response(l_http_response);
    dbms_output.put_line('midas5');
    l_response.doc := XMLTYPE.createxml(l_envelope);
    dbms_output.put_line('midas6');
    l_response.envelope_tag := p_request.envelope_tag;
    dbms_output.put_line('midas7');
    l_response.doc := l_response.doc.extract('/'||
    l_response.envelope_tag||':Envelope/'||l_response.envelope_tag||':Body/
    child::node()',
    'xmlns:'||
    l_response.envelope_tag||'="http://schemas.xmlsoap.org/soap/
    envelope/"');
    -- show_envelope(l_response.doc.getstringval());
    dbms_output.put_line('midas8');
    check_fault(l_response);
    dbms_output.put_line('midas9');
    RETURN l_response;
    END;
    FUNCTION get_return_value(p_response IN OUT NOCOPY t_response,
    p_name IN VARCHAR2,
    p_namespace IN VARCHAR2)
    RETURN VARCHAR2 AS
    BEGIN
    -- RETURN p_response.doc.extract('//'||p_name||'/
    child::text()',p_namespace).getstringval();
    dbms_output.put_line('function');
    dbms_output.put_line(p_name);
    DBMS_OUTPUT.PUT_LINE (p_response.doc.extract('//'||p_name||'/
    child::text()', p_namespace).getstringval());
    RETURN p_response.doc.extract('//'||p_name||'/child::text()',
    p_namespace).getstringval();
    END;
    END SOAP_API_PKG;
    Any help greatly appreciated!!

    Hello,
    I have not looked in detail to you code but I would like to point out that Oracle provides utilities to call Web Services from the database, using a DB package and/or Java in the DB.
    Have you looked to the documentation about:
    - Developing a Web Service Client in the Database
    regards
    Tugdual Grall

  • Can any one show me how to call web service using soap lite mod perl client

    Hi,  Experts
    SAP is new for me and now I need to develop a perl client using soap lite, I have read "HOWTO: SCRIPTING LANGUAGE SUPPORT FOR SAP SERVICES - PERL" but not quit understand that. Can some one show me a real perl client example?
    I enclosed the wsdl file generated from SAP web service.
    <?xml version="1.0" encoding="utf-8" ?>
    - <wsdl:definitions targetNamespace="urn:sap-com:document:sap:rfc:functions" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="urn:sap-com:document:sap:rfc:functions" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    - <wsdl:types>
    - <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="urn:sap-com:document:sap:rfc:functions" targetNamespace="urn:sap-com:document:sap:rfc:functions" elementFormDefault="unqualified" attributeFormDefault="qualified">
    - <xsd:element name="Z_RFC_WEBSERVICE">
    - <xsd:complexType>
      <xsd:sequence />
      </xsd:complexType>
      </xsd:element>
    - <xsd:element name="Z_RFC_WEBSERVICEResponse">
    - <xsd:complexType>
    - <xsd:sequence>
      <xsd:element name="EV_STRING" type="xsd:string" />
      </xsd:sequence>
      </xsd:complexType>
      </xsd:element>
      </xsd:schema>
      </wsdl:types>
    - <wsdl:message name="Z_RFC_WEBSERVICE">
      <wsdl:part name="parameters" element="tns:Z_RFC_WEBSERVICE" />
      </wsdl:message>
    - <wsdl:message name="Z_RFC_WEBSERVICEResponse">
      <wsdl:part name="parameters" element="tns:Z_RFC_WEBSERVICEResponse" />
      </wsdl:message>
    - <wsdl:portType name="Z_RFC_WEBSERVICE">
    - <wsdl:operation name="Z_RFC_WEBSERVICE">
      <wsdl:input message="tns:Z_RFC_WEBSERVICE" />
      <wsdl:output message="tns:Z_RFC_WEBSERVICEResponse" />
      </wsdl:operation>
      </wsdl:portType>
    - <wsdl:binding name="Z_RFC_WEBSERVICESoapBinding" type="tns:Z_RFC_WEBSERVICE">
      <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
    - <wsdl:operation name="Z_RFC_WEBSERVICE">
      <soap:operation soapAction="" />
    - <wsdl:input>
      <soap:body use="literal" />
      </wsdl:input>
    - <wsdl:output>
      <soap:body use="literal" />
      </wsdl:output>
      </wsdl:operation>
      </wsdl:binding>
    - <wsdl:service name="Z_RFC_WEBSERVICEService">
    - <wsdl:port name="Z_RFC_WEBSERVICESoapBinding" binding="tns:Z_RFC_WEBSERVICESoapBinding">
      <soap:address location="http://darkwind:9080/sap/bc/srt/rfc/sap/Z_RFC_WEBSERVICE?sap-client=800" />
      </wsdl:port>
      </wsdl:service>
      </wsdl:definitions>
    Thanks for your help!

    now I know how to call from perl tool,
    #!/usr/bin/perl -wd
    use SOAP::Lite;
        use SOAP::Lite +trace;
       my $client = SOAP::Lite->new();
       $client->uri('urn:Z_RFC_WEBSERVICE');
       $client->on_action(sub {return'""'});
       $client->proxy('http://darkwind:9080/sap/bc/srt/rfc/sap/Z_RFC_WEBSERVICE?sap-client=800');
       my $som = $client->Z_RFC_WEBSERVICE();
       my $output = $som->result;
       print $output  "\n";
    but I got "Operation not supported" error when executing 
    my $som = $client->Z_RFC_WEBSERVICE();
    here is trace:
    SOAP::Transport::new: ()
    SOAP::Serializer::new: ()
    SOAP::Deserializer::new: ()
    SOAP::Parser::new: ()
    SOAP::Lite::new: ()
    SOAP::Transport::HTTP::Client::new: ()
    SOAP::Lite::call: ()
    SOAP::Serializer::envelope: ()
    SOAP::Serializer::envelope: Z_RFC_WEBSERVICE testtypesZ_RFC_WEBSERVICE
    SOAP::Data::new: ()
    SOAP::Data::new: ()
    SOAP::Data::new: ()
    SOAP::Data::new: ()
    SOAP::Data::new: ()
    SOAP::Transport::HTTP::Client::send_receive: HTTP::Request=HASH(0x93f14a4)
    SOAP::Transport::HTTP::Client::send_receive: POST http://darkwind:9080/sap/bc/srt/rfc/sap/Z_RFC_WEBSERVICE?sap-client=800 HTTP/1.1
    Accept: text/xml
    Accept: multipart/*
    Content-Length: 552
    Content-Type: text/xml; charset=utf-8
    SOAPAction: ""
    <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/1999/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><namesp1:Z_RFC_WEBSERVICE xmlns:namesp1="urn:Z_RFC_WEBSERVICE"><c-gensym3 xsi:type="xsd:string">testtypesZ_RFC_WEBSERVICE</c-gensym3></namesp1:Z_RFC_WEBSERVICE></SOAP-ENV:Body></SOAP-ENV:Envelope>
    SOAP::Transport::HTTP::Client::send_receive: HTTP::Response=HASH(0x93eb288)
    SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 500 Internal Server Error
    Server: SAP Web Application Server (1.0;700)
    Content-Length: 264
    Content-Type: text/xml; charset=utf-8
    Client-Date: Sat, 14 Feb 2009 19:33:50 GMT
    Client-Peer: 146.225.80.176:9080
    Client-Response-Num: 1
    Sap-Srt-Id: 20090214/113349/v1.00_final_6.40/49958133C5E634E8E100000092E150B0
    Set-Cookie: sap-usercontext=sap-client=800; path=/
    <soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"><soap-env:Body><soap-env:Fault><faultcode>soap-env:Client</faultcode><faultstring xml:lang="en">Operation not supported</faultstring></soap-env:Fault></soap-env:Body></soap-env:Envelope>
    SOAP::Deserializer::deserialize: ()
    SOAP::Parser::decode: ()
    SOAP::SOM::new: ()
    Can't use an undefined value as a symbol reference at ./sapClient.pl line 10.
    SOAP::Lite::DESTROY: ()
    SOAP::Deserializer::DESTROY: ()
    SOAP::Parser::DESTROY: ()
    SOAP::Transport::DESTROY: ()
    SOAP::Transport::HTTP::Client::DESTROY: ()
    SOAP::Serializer::DESTROY: ()
    SOAP::Data::DESTROY: ()
    SOAP::Data::DESTROY: ()
    SOAP::Data::DESTROY: ()
    SOAP::Data::DESTROY: ()
    SOAP::Data::DESTROY: ()
    SOAP::SOM::DESTROY: ()
    Ran SAP Web Service Navigator Test 'Z_RFC_WEBSERVICE' OK
    Can someone help?
    Thanks!

  • How to print SOAP request at client program when program calls web service.

    Hi friends,
    While calling a web service, I am getting following error: javax.xml.rpc.JAXRPCException: Failed to parse WSDL
    I believe it is due to an invalid parameter set for the request soap. I need to analysis this error. Can you help me to print SOAP request at client program when program calls web service.
    Is there any way to print SOAP request XML?
    Thanks.
    Jaykishan

    Is this question related to Oracle SOA suite? Which client are you using? Use SOAPUI to validate whether WSDL is correct.
    Regards,
    Anuj

  • SOAP service works - but doesn't call application logic

    I have an SAP enterprise service that's acting weird. Like any other SOAP service, I went to SOAMANAGER and configured the necessary binding. The bgRFC settings were missing - went to SRT_TOOLS and configured all of it.
    While testing it with SOAMANAGER it work fine the first time. No problems in SRTUTIL and the SLG1 log entries were also perfect.
    However, subsequent trials threw up weird results. I always get a http 202. This means that the call is going to the server. The SRTUTIL payload trace vouches for this. But there is no SLG1 entry! The application logic is not being called at all!
    I checked all the settings in SRT_TOOLS - no changes. I made no changes whatsoever! It would be great if any of you could offer some help here.

    You don't say what VPN you use but for PPTP you need GRE protocol passthrough, without it you can connect but no traffic will pass over the VPN tunnel.
    You give VPN clients an IP from the LAN interface "range" in VPN settings?
    DNS in VPN settings must be reachable through the VPN (default route is through VPN? - any routing definitions?).

  • Calling a service through the EJB results in java.rmi.UnmarshalException

    I have created a service on WLAI that does a simple query against a table (inventory
    count by product ID). I have also created a command line class to call this service,
    provide the correct XML schema input, and wait for a returning XML response.
    The class compiles fine, but at runtime I am hitting a java.rmi.UnmarshalException,
    with a nested exception of a java.lang.ClassNotFoundException on the class com.bea.wlai.client.bean.ApplicationViewBeanEOImpl_WLStub.
    However, I am positive this class is in the classpath on the remote computer
    running WLAI in the %INTEGRATION_HOME%\applinteg\lib\WLAIlib.jar file.
    I have been told that RMI calls run off a separate classpath, and that may be
    why this class cannot be found. However, I am not familiar with such situations.
    Any ideas or thoughts would be greatly appreciated. Please respond to this thread
    with any thoughts or if you need any more information. Thanks.
    Dan Kim

    Maybe u must cast appMod to the generated class 'TestbcModuleEJBClient', in the automatically generated client project, instead of 'TestbcModule', that's only an interface. In this way appMod should find the implementation of your methods, and not only the declaration. That is:
    appMod = (TestbcModuleEJBClient) home.create ();
    Christian T.
    null

Maybe you are looking for