Problem accessing https Web service from behind proxy

Hi all,
I have this constant timeout issue which occurs whenever I try to access the Web service from behind a proxy.
Find below the error logs -
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.net.ConnectException: Connection timed out: connect
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
at java.net.Socket.connect(Socket.java:452)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.axis.components.net.DefaultSocketFactory.create(DefaultSocketFactory.java:136)
at org.apache.axis.components.net.DefaultSocketFactory.create(DefaultSocketFactory.java:100)
at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:129)
at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:389)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:87)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:144)
at org.apache.axis.client.Call.invokeEngine(Call.java:2688)
at org.apache.axis.client.Call.invoke(Call.java:2671)
at org.apache.axis.client.Call.invoke(Call.java:2357)
at org.apache.axis.client.Call.invoke(Call.java:2280)
at org.apache.axis.client.Call.invoke(Call.java:1741)
I am using Tomcat 5.0.19 . Could anyone suggest a possible solution to the same?
The system works fine when I use a http endpoint.

Hi,
By default, your application tries to connect to the Net directly : if you have to specify a proxy, use either these lines in your code :
System.setProperty("http.proxySet", "true");
System.setProperty("http.proxyHost", "proxy");
System.setProperty("http.proxyPort", "8080");
Or specify them in the command line with the "-D"option.
Ex : java .... -Dhttp.proxySet=true .... MyApp
Hope it helps.
See ya

Similar Messages

  • How To Access HTTPS Web Service  in Application Module

    I need to know how to access HTTPS web service in application module.
    If you can provide the tutorial or guidance to achieve this really appreciate.
    Thanks
    Sameera

    Use the Web Service Proxy wizard in JDeveloper to create a class that calls your Web service, and then call this class from code in your AM.
    http://docs.oracle.com/cd/E16340_01/web.1111/b31974/web_services.htm#CJAHGIEF

  • Trying to access https web service

    Hello: I'm on 4.1.1. I created web service referece for wsdl for http and it worked fine (http://www.webservicex.net/CurrencyConvertor.asmx?wsdl). Now I'm trying to connect to wsdl using https (https://stage.e-verify.uscis.gov/WebService/EmployerWebServiceV23.asmx?wsdl). I went into owm (oracle wallet manager) to create a wallet. I have pointed the apex instance to that wallet. I have completed the wizard to create a report and form on a web service but it is not working.
    I hit the test connection, but get no response. I used to get an ACL/Wallet error before setting up the wallet and pointing to it. After setting up the wallet I no longer get that error, but no response either. I then did the Import Trusted Certificate in owm to pull in a PKCS #7 file I grabbed from the https website. But I still get no response. I can try importing the BASE64 certificate, but don't expect it to help.
    One thing I notice is that the Username and Password entered when testing the web service reference does not appear in the request. I expect to get a response even if the Username and Password are wrong, but I don't, and they are not even in the request that I can see.
    Are there any examples for setting up an https connection using wsdl with apex and wallet?
    Thanks, Hawk
    Edited by: Hawk on May 1, 2012 2:29 PM

    At first I couldn't believe it would require going to the trouble of installing certificates just to access https web services. A Google search about APEX and SSL web services seemed to confirm it, but apparently that was all just a red herring.
    There's one other thing I should mention in case it helps. APEX support for WSDL, even on 4.1, is still a little rudimentary. I've had problems with it on a few .NET generated web services in the past. Machine generated WSDL based on insanely whacky objects built by OOPtards is just too complex for the APEX WSDL interpreter. I'm just imaging the APEX WSDL component being hand forged in a musty corner of a cube farm somewhere and this large sweaty hammer wielding PL/SQL code cutter with his furnace and anvil beating out something to do the job.
    If you're feeling brave, reach for your biggest code hammer. There's one more painful option that will certainly do the job. Process the WSDL locally on your desktop and generate your own SOAP envelopes based on that (SoapUI is a good tool for this). Then create a custom pl/sql package to send your web service request along with the envelope substituting any parameters you might need as the request and do what you need with the response. Just beware, here be a dragon convention.

  • How to access a web service from a XLet

    Hello,
    I am new in software development to ITV and I dint find too many usefull information teaching how to access a web service from a XLet running in a STB. Are there anybody who can give me some help, maybe sample or tutorial?
    Gratefull
    David

    hi,
    you can "borrow" the source code from [Yambo a free soft open source presentation engine (AKA XML microbrowser Xlet )|http://www.cineca.tv/labs/mhplab/index-en.html] both local and on a http remote connection.
    hope it helps..
    bye
    andrea

  • How to use Axis to access a web service through Authentication  proxy

    Using axis access internat web service is success,but access a web service through Authentication proxy is failure.But other java classes connect through a proxy to the internet which works very well:
    please help me ,thank you!!!
    import org.apache.axis.client.Call;
    import org.apache.axis.client.Service;
    import javax.xml.namespace.QName;
    //this is my access webservice faliure   codes
    public class TestClient
       public static void main(String [] args) {
           try {
                System.getProperties().setProperty("http.proxySet", "true");
                System.getProperties().setProperty("http.proxyHost","proxy.com");
                System.getProperties().setProperty("http.proxyPort", "8080");
                System.getProperties().setProperty("http.proxyUser", "username");
                System.getProperties().setProperty("http.proxyPassword","password");
               String endpoint =
                        "http://nagoya.apache.org:5049/axis/services/echo";
               Service  service = new Service();
               Call     call    = (Call) service.createCall();
               call.setTargetEndpointAddress( new java.net.URL(endpoint) );
               call.setOperationName(new QName("http://soapinterop.org/", "echoString") );
               String ret = (String) call.invoke( new Object[] { "Hello!" } );
               System.out.println("Sent 'Hello!', got '" + ret + "'");
           } catch (Exception e) {
               System.err.println(e.toString());
       }I get an "(407)Proxy authorization required" error?

    I am also looking for a solution. Does any one know how to do through code instead of jvm settings?
    Thanks in advance!

  • New to Web Services - need to call a HTTPS web service from PL/SQL

    I am new to Web Services and need to call HTTPS web service from PL/SQL program. I am using 10g Database.
    I have been reading there are 2 options -
    1. UTL_HTTP - with this package its possible to call HTTPS web services
    2. UTL_DBWS
    Questions -
    1. Is it possible to call a HTTPS web service using UTL_DBWS ? I have not been able to find any information on it.
    2. Can someone point me to UTL_HTTP and UTL_DBWS examples calling a HTTPS web service ?
    3. The HTTPS web service that I need to call needs username/password to connect - how will I incorporate this in the pl/sql code ?
    Appreciate the help.
    Cheers,
    newWebServicesUser

    Hi,
    1. UTL_DBWS not work for https from what I understand
    2. Here is a sample example:
    [http://www.oracle-base.com/articles/9i/ConsumingWebServices9i.php#]
    Be careful, you must change http/1.0 IN 1.1 inside package SOAP_API.
    Here is an example for a prime number where the SOAP message is already construct:
    CREATE OR REPLACE procedure test_ws_2
    IS
    http_req utl_http.req;
    http_resp utl_http.resp;
    request_env varchar2(32767);
    response_env varchar2(32767);
    begin
    -- Set proxy details if no direct net connection.
    UTL_HTTP.set_proxy('http://<USER>:<PASS>@10.0.2.21:8070', NULL);
    UTL_HTTP.set_persistent_conn_support(TRUE);
    request_env:='<?xml version="1.0" encoding="utf-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema">'||
    '<SOAP-ENV:Body><GetPrimeNumbers xmlns="http://microsoft.com/webservices/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">'||
    '<max xsi:type="xsd:int">10</max>'||
    '</GetPrimeNumbers></SOAP-ENV:Body></SOAP-ENV:Envelope>';
    dbms_output.put_line('Length of Request:' || length(request_env));
    dbms_output.put_line ('Request: ' || request_env);
    http_req := utl_http.begin_request('http://www50.brinkster.com/vbfacileinpt/np.asmx','POST', utl_http.HTTP_VERSION_1_1);
    utl_http.set_header(http_req, 'Content-Type', 'text/xml; charset=utf-8');
    utl_http.set_header(http_req, 'Content-Length', length(request_env));
    utl_http.set_header(http_req, 'SOAPAction', '"http://microsoft.com/webservices/GetPrimeNumbers"');
    utl_http.write_text(http_req, request_env);
    dbms_output.put_line('');
    http_resp := utl_http.get_response(http_req);
    dbms_output.put_line('Response Received');
    dbms_output.put_line('--------------------------');
    dbms_output.put_line ( 'Status code: ' || http_resp.status_code );
    dbms_output.put_line ( 'Reason phrase: ' || http_resp.reason_phrase );
    utl_http.read_text(http_resp, response_env);
    dbms_output.put_line('Response: ');
    dbms_output.put_line(response_env);
    utl_http.end_response(http_resp);
    end test_ws_2;
    Otherwice for testing url, i recommand you to use that function: Re: Error using UTL_HTTP over HTTPS
    it's a verry helpful function when you have an error.
    wrote:
    When testing using UTL_HTTP, you MUST ensure that you open a new session after importing the SSL certificates into your Wallet,
    as I've learned (the hard way) that existing sessions point to the wallet contents that were present when the session was opened.
    If you don't realise/know this, it can cause a lot of additional frustration during testing, when you keep getting the ORA-29024 exception AFTER
    you've imported the SSL certificates................. ;) 3. i think you can use that after the begin_request but not sure :
    UTL_HTTP.set_authentication(r => http_req,
    username => ,
    password => ,
    scheme => ,
    for_proxy => );
    Edited by: Malebodja on Oct 22, 2009 6:53 AM
    Edited by: Malebodja on Oct 22, 2009 6:55 AM

  • Access a web service from pl/sql

    I am trying to access a web service from pl/sql. I have downloaded the code from
    http://www.oracle.com/technology/tech/webservices/htdocs/samples/dbwebservice/DBWebServices_PLSQL.html
    But when I try to execute the sql, I am getting the following error:
    SQL> @local.sql
    Package created.
    Package body created.
    No errors.
    BEGIN dbms_output.put_line(time_service.get_local_time('94065')); END;
    ERROR at line 1:
    ORA-29273: HTTP request failed
    ORA-06512: at "SYS.UTL_HTTP", line 1022
    ORA-12545: Connect failed because target host or object does not exist
    ORA-06512: at "WEB.DEMO_SOAP", line 71
    ORA-06512: at "WEB.TIME_SERVICE", line 15
    ORA-06512: at line 1
    It is failing at:
    resp := demo_soap.invoke(req,
    'http://www.ripedev.com/webservices/LocalTime.asmx',
    'http://ripedev.com/xsd/ZipCodeResults.xsd/LocalTimeByZipCode');
    But in the examples that I got from downloading source code, site used was:
    'http://www.alethea.net/webservices/LocalTime.asmx',
    'http://www.alethea.net/webservices/LocalTimeByZipCode');
    This site was not accessible. So I changed to the working site as follows, but still I
    am getting the above error.
    But I can access this site, if I type in the above address in the address bar of IE.
    Can any body help?
    I have oracle9i client installed on my machine and able to connect to server thru toad and sql plus.
    or IF any body refers me to a good website for the topic of "using webservies from pl/sql" that would be great too!

    Here is the complete code:
    time_service:
    CREATE OR REPLACE PACKAGE time_service AS
    FUNCTION get_local_time(zipcode IN VARCHAR2) RETURN VARCHAR2;
    END;
    CREATE OR REPLACE PACKAGE BODY time_service AS
    -- Location of Web service definition
    -- http://www.alethea.net/webservices/LocalTime.asmx?WSDL
    -- http://www.ripedev.com/webservices/LocalTime.asmx?WSDL
    -- http://www.xmethods.com/sd/2001/CurrencyExchangeService.wsdl
    --'http://ripedev.com/xsd/ZipCodeResults.xsd/LocalTimeByZipCode style=document');
    FUNCTION get_local_time(zipcode IN VARCHAR2) RETURN VARCHAR2 IS
    req demo_soap.request;
    resp demo_soap.response;
    BEGIN
    dbms_output.put_line('before new request..');
    req := demo_soap.new_request('LocalTimeByZipCode',
    'xmlns="http://ripedev.com/xsd/ZipCodeResults.xsd"');
    dbms_output.put_line('before add param..');
    demo_soap.add_parameter(req, 'ZipCode', 'xsd:string', zipcode);
    dbms_output.put_line('before invoke..');
    resp := demo_soap.invoke(req,
    'http://www.ripedev.com/webservices/LocalTime.asmx',
    'http://ripedev.com/xsd/ZipCodeResults.xsd/LocalTimeByZipCode');
    dbms_output.put_line('before return..');
    RETURN demo_soap.get_return_value(resp, 'LocalTimeByZipCodeResult',
    'xmlns="http://www.ripedev.com/webservices/"');
    END;
    BEGIN
    dbms_output.put_line('inside main time_service..');
    END;
    show errors
    SET serveroutput ON
    exec dbms_output.put_line(time_service.get_local_time('94065'));
    Here is demo_soap.sql:
    Rem
    Rem $Header: soapdemo.sql 21-may-2002.13:48:17 rpang Exp $
    Rem
    Rem soapdemo.sql
    Rem
    Rem Copyright (c) 2002, Oracle Corporation. All rights reserved.
    Rem
    Rem NAME
    Rem soapdemo.sql - <one-line expansion of the name>
    Rem
    Rem DESCRIPTION
    Rem A PL/SQL demo package for making SOAP RPC calls.
    Rem
    Rem NOTES
    Rem This demo package can only be used in oracle 9ir2. It utilizes 9iR2's
    Rem XDB (XMLType and HttpUriType) and 9iR1's enhancements to UTL_HTTP to
    Rem make SOAP RPC calls.
    Rem
    Rem MODIFIED (MM/DD/YY)
    Rem rpang 05/21/02 - created
    Rem
    Rem A PL/SQL demo package that makes a SOAP RPC calls.
    Rem
    CREATE OR REPLACE PACKAGE demo_soap AS
    /* A type to represent a SOAP RPC request */
    TYPE request IS RECORD (
    method VARCHAR2(256),
    namespace VARCHAR2(256),
    body VARCHAR2(32767));
    /* A type to represent a SOAP RPC response */
    TYPE response IS RECORD (
    doc xmltype);
    * Create a new SOAP RPC request.
    FUNCTION new_request(method IN VARCHAR2,
    namespace IN VARCHAR2)
    RETURN request;
    * Add a simple parameter to the SOAP RPC request.
    PROCEDURE add_parameter(req IN OUT NOCOPY request,
    name IN VARCHAR2,
    type IN VARCHAR2,
    value IN VARCHAR2);
    * Make the SOAP RPC call.
    FUNCTION invoke(req IN OUT NOCOPY request,
    url IN VARCHAR2,
    action IN VARCHAR2) RETURN response;
    * Retrieve the sipmle return value of the SOAP RPC call.
    FUNCTION get_return_value(resp IN OUT NOCOPY response,
    name IN VARCHAR2,
    namespace IN VARCHAR2) RETURN VARCHAR2;
    END;
    show errors
    CREATE OR REPLACE PACKAGE BODY demo_soap AS
    FUNCTION new_request(method IN VARCHAR2,
    namespace IN VARCHAR2)
    RETURN request AS
    req request;
    BEGIN
    req.method := method;
    req.namespace := namespace;
    RETURN req;
    END;
    PROCEDURE add_parameter(req IN OUT NOCOPY request,
    name IN VARCHAR2,
    type IN VARCHAR2,
    value IN VARCHAR2) AS
    BEGIN
    req.body := req.body ||
    '<'||name||' xsi:type="'||type||'">'||value||'</'||name||'>';
    END;
    PROCEDURE generate_envelope(req IN OUT NOCOPY request,
                   env IN OUT NOCOPY VARCHAR2) AS
    BEGIN
    env := '<SOAP-ENV:Envelope
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/1999/XMLSchema">
    <SOAP-ENV:Body><'||req.method||' '||req.namespace||'
    SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">'||
    req.body||'</'||req.method||'></SOAP-ENV:Body></SOAP-ENV:Envelope>';
    END;
    PROCEDURE show_envelope(env IN VARCHAR2) AS
    i pls_integer;
    len pls_integer;
    BEGIN
    i := 1; len := length(env);
    WHILE (i <= len) LOOP
    dbms_output.put_line(substr(env, i, 60));
    i := i + 60;
    END LOOP;
    END;
    PROCEDURE check_fault(resp IN OUT NOCOPY response) AS
    fault_node xmltype;
    fault_code VARCHAR2(256);
    fault_string VARCHAR2(32767);
    BEGIN
    fault_node := resp.doc.extract('/soap:Fault',
    'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/');
    IF (fault_node IS NOT NULL) THEN
    fault_code := fault_node.extract('/soap:Fault/faultcode/child::text()',
         'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/').getstringval();
    fault_string := fault_node.extract('/soap:Fault/faultstring/child::text()',
         'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/').getstringval();
    raise_application_error(-20000, fault_code || ' - ' || fault_string);
    END IF;
    END;
    FUNCTION invoke(req IN OUT NOCOPY request,
    url IN VARCHAR2,
    action IN VARCHAR2) RETURN response AS
    env VARCHAR2(32767);
    http_req utl_http.req;
    http_resp utl_http.resp;
    resp response;
    BEGIN
    generate_envelope(req, env);
    -- show_envelope(env);
    http_req := utl_http.begin_request(url, 'POST','HTTP/1.0');
    utl_http.set_header(http_req, 'Content-Type', 'text/xml');
    utl_http.set_header(http_req, 'Content-Length', length(env));
    utl_http.set_header(http_req, 'SOAPAction', action);
    utl_http.write_text(http_req, env);
    http_resp := utl_http.get_response(http_req);
    utl_http.read_text(http_resp, env);
    utl_http.end_response(http_resp);
    resp.doc := xmltype.createxml(env);
    resp.doc := resp.doc.extract('/soap:Envelope/soap:Body/child::node()',
    'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"');
    -- show_envelope(resp.doc.getstringval());
    check_fault(resp);
    RETURN resp;
    END;
    FUNCTION get_return_value(resp IN OUT NOCOPY response,
    name IN VARCHAR2,
    namespace IN VARCHAR2) RETURN VARCHAR2 AS
    BEGIN
    RETURN resp.doc.extract('//'||name||'/child::text()',
    namespace).getstringval();
    END;
    END;
    show errors

  • How to call "https" web service from Oracle without certification.

    The reuirement is to call a secured web service (*https web service*) from Oracle9i without involving any additional cost.
    Initialy I tried with UTL_HTTP package but in vain as it is needed some certification. As per the requirement no additional cost should be involved with the implementation.
    So is there any way to achieve the above mentioned problem?
    Please let me know the responses with the sample code/steps.

    Please try not to double post. You have the ability to edit your original thread.
    Oh, BTW, try searching the forum. A quick search turned up this: HTTPS request signed by client certificate from PL/SQL procedure
    Check that out and maybe that will solve your problems.
    Thanks!

  • Problem with accessing a web service from outside world

    Hello SAP experts
    I have a custom BAPI for which I have created a webservice.
    If I login as an admin to the BOX where I have installed this SAP server and open an internet explorer window and give the URL, I can access the web service without any problem. This is just a simple BAPI that searches for some data from a table based.
    However, when I give the same URL from a different PC, it can open the web service and in the fields if I give the data and click on send button, it fails with an error '500 Internal Server Error '.
    I looked for the details of this error on internet and it says that this is some general error and solutions that it suggested doesn't help my scenario.
    Has anyone seen this problem before? Any help will be highly appreciated.
    Tks
    Ram

    i have tried the stack trace in the catch but as i said on the statement where i made the object for the service the program just exits. it didn't return any exception or any output.
    thanx for refering me any answer.......

  • Have problem when generate Web Service from bapi function

    Dear all,
    Please kindly help me about generating Web Service from BAPI function, It does not success only this attached function.
    I have done so many function without any problems.
    I found 1 case that I use specific variable to be an import/ export then, it can't create as well.
    As for this one, I try so many changes but I can't success it as well.
    This is my function on R/3 4.6C, Dot net connector 2.0, Dot net Frame Work 1.1.
    FUNCTION Z_BAPI_ATTACHMENT_CREATE.
    ""Local interface: Type: Remote-enabled module
    *"  IMPORTING
    *"     VALUE(P_BOTYPE) LIKE  BORIDENT-OBJTYPE
    *"     VALUE(P_BO_ID) LIKE  BORIDENT-OBJKEY
    *"     VALUE(P_MSGTYP) LIKE  SOFM-DOCTP
    *"     VALUE(P_DOCTY) LIKE  BORIDENT-OBJTYPE
    *"     VALUE(P_RELTYP) LIKE  BRELTYP-RELTYPE
    *"     VALUE(P_FNAME) LIKE  RLGRAP-FILENAME
    *"     VALUE(P_OBJDES) TYPE  SO_OBJ_DES
    *"  EXPORTING
    *"     VALUE(RETURNMESSAGE) TYPE  CHAR50
    INCLUDE : <cntn01>.
    P_BOTYPE  TYPE  BORIDENT-OBJTYPE DEFAULT 'BUS2105'
    P_BO_ID   TYPE  BORIDENT-OBJKEY
    P_MSGTYPE TYPE  SOFM-DOCTP DEFAULT 'URL'
    P_DOCTY   TYPE  BORIDENT-OBJTYPE DEFAULT 'MESSAGE'
    P_RELTYP  TYPE  BRELTYP-RELTYPE DEFAULT 'ATTA'
    P_FNAME   TYPE  RLGRAP-FILENAME
    P_OBJDES  TYPE  SO_OBJ_DES
    TYPES: BEGIN OF ty_message_key,
    foltp TYPE so_fol_tp,
    folyr TYPE so_fol_yr,
    folno TYPE so_fol_no,
    doctp TYPE so_doc_tp,
    docyr TYPE so_doc_yr,
    docno TYPE so_doc_no,
    fortp TYPE so_for_tp,
    foryr TYPE so_for_yr,
    forno TYPE so_for_no,
    END OF ty_message_key.
    DATA : lv_message_key TYPE ty_message_key.
    DATA : lo_message TYPE swc_object.
    DATA : lt_doc_content TYPE STANDARD TABLE OF soli-line
    WITH HEADER LINE.
    First derive the Attachment's ( MESSAGE )document type.
    p_docty = 'MESSAGE'.
    CASE p_reltyp.
    In case of URls
      WHEN 'URL'.
        p_msgtyp = 'URL'.
    In case of Notes / Private Notes
      WHEN 'NOTE' OR 'PNOT'.
        p_msgtyp = 'RAW'.
      WHEN 'ATTA'.
    Take given parameter e.g. 'DOC', 'PDF' etc.
    P_MSGTYP = 'EXT'.
      WHEN OTHERS.
    ....exit
        EXIT.
    ENDCASE.
    Create an initial instance of BO 'MESSAGE' - to call the
    instance-independent method 'Create'.
    swc_create_object lo_message 'MESSAGE' lv_message_key.
    define container to pass the parameter values to the method call
    in next step.
    swc_container lt_message_container.
    Populate container with parameters for method
    swc_set_element lt_message_container 'DOCUMENTTITLE' p_objdes.
    swc_set_element lt_message_container 'DOCUMENTLANGU' 'E'.
    swc_set_element lt_message_container 'NO_DIALOG' 'X'.
    swc_set_element lt_message_container 'DOCUMENTNAME' p_docty.
    swc_set_element lt_message_container 'DOCUMENTTYPE' p_msgtyp.
    In case of URLs..it should be concatenated with &KEY& in the begining.
    CASE p_msgtyp.
      WHEN 'URL'.
      lt_doc_content = '&KEY&http://www.rmtiwari.com' .
        CONCATENATE '&KEY&' p_fname INTO lt_doc_content.
        APPEND lt_doc_content.
    In case of Notes or Private Notes, get the data from files on appl
    server or from wherever(? - remember background).
      WHEN 'RAW'.
        lt_doc_content = p_fname.
        APPEND lt_doc_content.
    In case of PC File attachments
      WHEN OTHERS.
        OPEN DATASET p_fname FOR INPUT IN BINARY MODE.
        IF sy-subrc EQ 0.
          DO.
            READ DATASET p_fname INTO lt_doc_content.           "2 of 27
            IF sy-subrc EQ 0.
              APPEND lt_doc_content.
            ELSE.
              EXIT.
            ENDIF.
          ENDDO.
          CLOSE DATASET p_fname.
        ENDIF.
    ENDCASE.
    'DocumentContent' is a multi-line element ( itab ).
    swc_set_table lt_message_container 'DocumentContent' lt_doc_content.
    Size is required in case of File attachments
    DATA : lv_doc_size TYPE i.
    DATA : l_file_lines TYPE i.
    DESCRIBE TABLE lt_doc_content LINES l_file_lines.
    READ TABLE lt_doc_content INDEX l_file_lines.
    lv_doc_size = ( 255 * ( l_file_lines - 1 ) ) +
    STRLEN( lt_doc_content ).
    swc_set_element lt_message_container 'DOCUMENTSIZE' lv_doc_size .
    Refresh to get the reference of create 'MESSAGE' object for attachment
    swc_refresh_object lo_message.
    swc_call_method lo_message 'CREATE' lt_message_container.
    Get Key of new object
    swc_get_object_key lo_message lv_message_key.
    Now we have attachment as a business object instance. We can now
    attach it to our main business object instance.
    Create main BO object_a
    data: LO_IS_OBJECT_A type SIBFLPORB. "type SIBFLPORB is unknown, so I
    DATA: lo_is_object_a TYPE borident.
    lo_is_object_a-objkey = p_bo_id.
    lo_is_object_a-objtype = p_botype.
    LO_IS_OBJECT_A-CATID = 'BO'.
    Create attachment BO object_b
    data: LO_IS_OBJECT_B type SIBFLPORB. "type SIBFLPORB is unknown
    DATA: lo_is_object_b TYPE borident.
    lo_is_object_b-objkey = lv_message_key.
    lo_is_object_b-objtype = p_docty.
    LO_IS_OBJECT_B-CATID = 'BO'.
    *TRY.
    *CALL METHOD CL_BINARY_RELATION=&gtCREATE_LINK
    EXPORTING
    IS_OBJECT_A = LO_IS_OBJECT_A
    IS_OBJECT_B = LO_IS_OBJECT_B
    IP_RELTYPE = P_RELTYP.
    CALL FUNCTION 'BINARY_RELATION_CREATE'
      EXPORTING
        obj_rolea    = lo_is_object_a
        obj_roleb    = lo_is_object_b
        relationtype = p_reltyp
      EXCEPTIONS
        OTHERS       = 1.
    Check if everything OK...who cares!!
    COMMIT WORK.
    if sy-subrc = 0.
      RETURNMESSAGE = 'S-Success'.
    else.
      RETURNMESSAGE = 'E-Error'.
    endif.
    ENDFUNCTION.
    Thanks in advance,
    Benjawan
    Edited by: Nitipat Chadchavalpanichaya on Oct 20, 2008 9:02 AM

    There is no any error message show up. It just the class
    Z_BAPI_ATTACHMENT_CREATE  doesn't create autometically as normal. I showed you as below.
    That means I can't call class z_bapi_attachment_create.
    ' <autogenerated>
    '     This code was generated by a SAP. NET Connector Proxy Generator Version 2.0
    '     Created at 21/10/2551
    '     Created from Windows
    '     Changes to this file may cause incorrect behavior and will be lost if
    '     the code is regenerated.
    ' </autogenerated>
    Imports System
    Imports System.Text
    Imports System.Collections
    Imports System.ComponentModel
    Imports System.Runtime.InteropServices
    Imports System.Xml.Serialization
    Imports System.Web.Services
    Imports System.Web.Services.Description
    Imports System.Web.Services.Protocols
    Imports SAP.Connector
      '@ <summary>
      '@ Client SAP proxy class
      '@ </summary>
      <WebServiceBinding(Name:="dummy.Binding", Namespace:="urn:sap-com:document:sap:rfc:functions")> _
      Public Class PRAttachment
        Inherits SAPClient
        '@ <summary>
        '@ Initializes a new PRAttachment.
        '@ </summary>
        Public Sub New()
        End Sub
        '@ <summary>
        '@ Initializes a new PRAttachment with a new connection based on the specified connection string.
        '@ </summary>
        '@ <param name="connectionString">A connection string (e.g. RFC or URL) specifying the system where the proxy should connect to.</param>
        Public Sub New(ByVal ConnectionString As String)
          MyBase.New(ConnectionString)
        End Sub
        '@ <summary>
        '@ Initializes a new PRAttachment and adds it to the given container.
        '@ This allows automated connection mananged by VS component designer:
        '@ If container is disposed, it will also dispose this SAPClient instance,
        '@ which will dispose a contained connection if needed.
        '@ </summary>
        '@ <param name="Cont">The container where the new SAPClient instance is to be added.</param>
        Public Sub New(ByVal Cont As Container)
          MyBase.New(Cont)
        End Sub
      End Class

  • How to access/invoke Web Service from BPM Process

    The following steps required to attach and invoke web service method from process:
    1) Add a module in the catalog for ex WebServiceMO
    2) Add WebService Catalog component demoWebService in WebServiceMO
    3) Put ur WSDL address in WSDL address field like "http://localhost:8080/test/test?wsdl"
    4) Click next to introspect the web service it will import required files and setting from the url to your project
    5) Now for invoking webservice just call the method for ex.
    @return as String[]
    getTestStringList(TestInterfaceService, out @return : @return)
    logMessage "web service calll result >>"+length(@return)+">>>"+@return[0]
    Here @ return is the return from webservice call.
    this way u can access web service from BPM process.
    Edited by: Anurag Yadav on Jul 17, 2009 2:19 PM

    I have a web service which does not return any value but when I introspect the web service, I have an out parameter to it.. Not sure why?
    For e.g.
    TestServiceListener.addTestNotes(TestNotes : testNotes, out TestNoteResponse : testNoteResponse);
    So here I see an out parameter, but my web-service has no out parameter...
    Any idea why is this happening?

  • Problem calling a web Service from BI Publisher (10.1.3.2 )

    We have published a PL/SQL Web Service (from Jdeveloper 10.1.3 ) into a SOA Suite server.
    As requirements from BI Publisher , we chose Document/Literal, SOAP 1.1.
    The Program Unit accept an input parameter (we tried NUMBER & STRING)
    The result is an XML formatted (PL/SQL functions returns a CLOB then converted as a String).
    When testing the Service call from the SOA Suite console, no problems.
    We declined a page with APEX to test this Web Service too : Test is OK
    We added this web service as a data source in BI Publisher :
    After typing WSDL URL, Method, Parameter
    After testing , we do not get the XML result but an error message, coming from Apache AXIS (seems to be the DynamicInvoker) :
    not know how to convert '50740' into org.apache.axis.client.Call@cd7fdb
    Our demo is very near to this example : http://blogs.oracle.com/xmlpublisher/2006/11/01#a123
    and the one from the BI Publisher documentation

    I can't say I know the answer but I wanted to share a thought on debugging the issue. Like you I am seeing an axis error for a parameter on a web service I know works. I can call it using BPEL, SoapUI, etc... I suspect that perhaps BI pub is having trouble interpreting the WSDL for the web service. Specifically, I suspect that since I have imported schemas in the WSDL and nested imports in the supporting XSD files, the process is getting confused. The request message is fairly simple with three optional parameters but the WSDL does use an import via the WSDL. I wanted to share this since this problem often comes up with various tooling and I am lacking time to work out a test case to prove this theory out any time soon. I will try to post once I find some time to test this theory but it may be a while. Reading the results of someone else's test would be just as good!

  • How to pass username/password to BPEL web service from java proxy?

    Hi all,
    Environment : SOA Suite 11g
    I am using basic http authentication in my SOA services using "oracle/wss_http_token_client_policy" policy. Now i need to invoke these SOA web services from a java proxy.
    Please let me know how this can be done.
    Thanks in advance

    Have you tried the below posts ?
    BPEL to invoke Webservice secured with HTTP Basic authentication
    Invoke a BPEL process using HTTP Basic Authentication
    http://docs.oracle.com/cd/E21764_01/web.1111/e13713/owsm_appendix.htm#CHDBAHBI
    Thanks,
    Vijay

  • Accessing XI web service from portal as client

    Hi all
    I need to access a web service which has been created on XI    
    server. I want to acess it from enterprise portal as a web service client. please provide related links to achieve this.
    thanks in advance
    vaishali

    Vaishali,
    never did this before, but some general ideas:
    Do you have an WSDL for that web service? Then simply use your NWDS and select New --> Portal Service --> From WSDL (or similar). What I mean is the following: NWDS can read WSDL files and will automatically generate a proxy for you that actually generates an ordinary portal service. This portal service then can be called by standard means in SAP EP.
    Regards,
    Dominik

  • Problems calling external Web Service from a Java Stored Procedure

    I'm using a sample code that I found here about calling external web services from a Java Store Procedure ( Credit Agency Web Service http://www.oracle.com/technology/sample_code/tech/java/jsp/samples/wsclient/Readme.html ) but when I run it ,send this error. I dont know what can I do or what is missing. Please help me. Thanks.
    Error: Premature EOF encountered [java.io.EOFException] [SOAPException: faultCode=SOAP-ENV:IOException; msg=Premature EOF encountered; targetException=java.io.EOFException: Premature EOF encountered] at org.apache.soap.SOAPException.(SOAPException.java:77) at oracle.soap.transport.http.OracleSOAPHTTPConnection.send(OracleSOAPHTTPConnection.java:765) at org.apache.soap.rpc.Call.invoke(Call.java:261) at oracle.otnsamples.wsclient.CreditAgencyServiceStub.authorizeCustomer(CreditAgencyServiceStub.java:84) at Products.jspService(Products.jsp:120) at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:139) at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:349) at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509) at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:795) at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330) at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:794) at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270) at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112) at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192) at java.lang.Thread.run(Thread.java:534)

    I'm also facing problem in running the example on the page http://www.oracle.com/technology/sample_code/tech/java/jsp/samples/wsclient/Readme.html
    I've Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 and Oracle Application Server 10g (10.1.3). When I executed the following command,
    loadjava -thin -user sys/password@localhost:1521:oradb -resolve -synonym -verbose -grant public %OC4J_HOME%/webservices/lib/soap.jar %OC4J_HOME%/lib/dms.jar %OC4J_HOME%/jlib/javax-ssl-1_1.jar %ORACLE_HOME%/lib/servlet.jar %OC4J_HOME%/j2ee/home/lib/mail.jar
    ... mentioned in step 3 under the "Configuring the Application" section on the above link, the process terminates with the following error
    The following operations failed
    class oracle/net/www/protocol/https/Handler: resolution
    class oracle/net/www/protocol/https/HttpsURLConnection: resolution
    class oracle/soap/client/ProviderManagerClient: resolution
    class oracle/soap/client/ServiceManagerClient: resolution
    class oracle/soap/providers/JavaProvider: resolution
    class oracle/soap/providers/ejbprov/EntityEJBProvider: resolution
    class oracle/soap/providers/ejbprov/StatefulEJBProvider: resolution
    class oracle/soap/providers/ejbprov/StatelessEJBProvider: resolution
    class oracle/soap/providers/sp/SpProvider: resolution
    class oracle/soap/server/http/SOAPServlet: resolution
    class oracle/soap/transport/http/OracleSOAPHTTPConnection$1: resolution
    class oracle/soap/transport/http/OracleSOAPHTTPConnection: resolution
    class org/apache/soap/messaging/Message: resolution
    class org/apache/soap/rpc/Call: resolution
    class org/apache/soap/rpc/RPCMessage: resolution
    class org/apache/soap/rpc/Response: resolution
    class javax/net/DefaultServerSocketFactory: creation (createFailed)
    class javax/net/DefaultSocketFactory: creation (createFailed)
    class javax/net/ServerSocketFactory: creation (createFailed)
    class javax/net/SocketFactory: creation (createFailed)
    class javax/net/ssl/DefaultSSLServerSocketFactory: creation (createFailed)
    class javax/net/ssl/DefaultSSLSocketFactory: creation (createFailed)
    class javax/net/ssl/HandshakeCompletedEvent: creation (createFailed)
    class javax/net/ssl/HandshakeCompletedListener: creation (createFailed)
    class javax/net/ssl/SSLException: creation (createFailed)
    class javax/net/ssl/SSLHandshakeException: creation (createFailed)
    class javax/net/ssl/SSLKeyException: creation (createFailed)
    class javax/net/ssl/SSLPeerUnverifiedException: creation (createFailed)
    class javax/net/ssl/SSLProtocolException: creation (createFailed)
    class javax/net/ssl/SSLServerSocket: creation (createFailed)
    class javax/net/ssl/SSLServerSocketFactory: creation (createFailed)
    class javax/net/ssl/SSLSession: creation (createFailed)
    class javax/net/ssl/SSLSessionBindingEvent: creation (createFailed)
    class javax/net/ssl/SSLSessionBindingListener: creation (createFailed)
    class javax/net/ssl/SSLSessionContext: creation (createFailed)
    class javax/net/ssl/SSLSocket: creation (createFailed)
    class javax/net/ssl/SSLSocketFactory: creation (createFailed)
    class javax/security/cert/Certificate: creation (createFailed)
    class javax/security/cert/CertificateEncodingException: creation (createFailed)
    class javax/security/cert/CertificateException: creation (createFailed)
    class javax/security/cert/CertificateExpiredException: creation (createFailed)
    class javax/security/cert/CertificateNotYetValidException: creation (createFailed)
    class javax/security/cert/CertificateParsingException: creation (createFailed)
    class javax/security/cert/X509Certificate: creation (createFailed)
    exiting : Failures occurred during processing
    I've checked the path to all the jar files.
    I tried to run the command again with system/password instead sys/password but then I got the following stacktrace:
    The following operations failed
    class oracle/net/www/protocol/https/Handler: resolution
    class oracle/net/www/protocol/https/HttpsURLConnection: resolution
    class oracle/soap/client/ProviderManagerClient: resolution
    class oracle/soap/client/ServiceManagerClient: resolution
    class oracle/soap/providers/JavaProvider: resolution
    class oracle/soap/providers/ejbprov/EntityEJBProvider: resolution
    class oracle/soap/providers/ejbprov/StatefulEJBProvider: resolution
    class oracle/soap/providers/ejbprov/StatelessEJBProvider: resolution
    class oracle/soap/providers/sp/SpProvider: resolution
    class oracle/soap/server/http/SOAPServlet: resolution
    class oracle/soap/transport/http/OracleSOAPHTTPConnection$1: resolution
    class oracle/soap/transport/http/OracleSOAPHTTPConnection: resolution
    class org/apache/soap/messaging/Message: resolution
    class org/apache/soap/rpc/Call: resolution
    class org/apache/soap/rpc/RPCMessage: resolution
    class org/apache/soap/rpc/Response: resolution
    exiting : Failures occurred during processing
    Thanks in advance for any useful help.
    -

Maybe you are looking for