Consuming a web service with a java client

hello
wanted to consume the following web service:
http://www.dataaccess.com/webservicesserver/numberconversion.wso
http://www.dataaccess.com/webservicesserver/numberconversion.wso?op=NumberToWords
so i used WSDL2Java to create client stubs n then followed it with a client program
public class XmethodsAccessor {
public static void main(String[] args) throws Exception{
org.apache.axis2.databinding.types.UnsignedLong x = new org.apache.axis2.databinding.types.UnsignedLong(10000L);
NumberConversionStub stub = new NumberConversionStub();
NumberConversionStub.NumberToWords request = new NumberConversionStub.NumberToWords();
request.setUbiNum(x);
NumberToWordsResponse response = stub.NumberToWords(request);
System.out.println("answer is : " + response.getNumberToWordsResult());
Upon running the program i get error
Exception in thread "main" org.apache.axis2.AxisFault: Connection reset
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:221)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:452)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:330)
at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:294)
at com.dataaccess.www.webservicesserver.NumberConversionStub.NumberToWords(NumberConversionStub.java:162)
at com.dataaccess.www.webservicesserver.XmethodsAccessor.main(XmethodsAccessor.java:19)
Caused by: org.apache.axis2.AxisFault: Connection reset
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:314)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:201)
... 5 more
Caused by: org.apache.axis2.AxisFault: Connection reset
at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:179)
at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:73)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:305)
... 6 more
Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:168)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
at java.io.BufferedInputStream.read(BufferedInputStream.java:235)
at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:77)
at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:105)
at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1115)
at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1832)
at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1590)
at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:995)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:397)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:558)
at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:176)
... 8 more
Can any one please tell me what im doin wrong and why is it not working.
Thanks
PS: am using Eclipse 3.2/Axis2 Eclipse plugin .. there were no compilation errors

Hi steve_224,
Would be extremely grateful if you could post the answer when you get a chance, have this problem too and haven't managed to resolve it yet...
Thanks in advance...
Kind regards,
DJ

Similar Messages

  • Consuming web services with a java application

    Hello,
    I want to consume an ABAP generated web service with a stand-alone Java application. I am very new to this topic and need some hints how this functionality could be achieved.
    How is the web service accessed by the Java application? What about security issues?
    Thank you in advance for your replies! They will be appreciated.
    Kindest regards

    Hi
    See this Help and Examples
    http://help.sap.com/saphelp_nw2004s/helpdata/en/e2/36a53dc1204c64e10000000a114084/frameset.htm
    Kind Regards
    Mukesh

  • Java web service with php SOAP client

    Hi!
    I have a Java web service with a procedure, which connects to a database:
    public boolean connectDB(String driver,String host, String user, String password)
    try {
    Class.forName(driver);
    connection =
    DriverManager.getConnection
    host
    , user
    , password
    return true;
    } catch (Exception v_exception) {
    System.out.println("connectDB(): " + v_exception);
    return false;
    If I call it from a PHP client, it doesn't work but doesn't throw any exceptions on the server side.
    The way I call it:
    $client = new SoapClient
    (<path>);
    try
    $conn=$client->connectDB();
    catch (SoapFault $exception)
    echo "\nexception: " .$exception;
    On the client side, I have an exception, but it's not very detailed:
    exception: Object id #2
    I had a simple function, too, which returns a string:
    public String getTestString()
    return "test";
    and if I call it from PHP, it's working...
    What may be the problem?

    Neither the simple "setter" methods work.. :(
    The php client side:
    $string="aladar";
    $client->setSample($string);
    $return = $client->getSample();
    The server side:
    public String sample;
    public String getSample() {
    return sample;
    public void setSample(String a_sample) {
    sample = a_sample;
    Any ideas?

  • Consuming a Web Service with WEB AS 6.40

    Hello,
    i try to consume a Webservice from the internet. I have configured the logical port and i created the client proxy as shown in the following real good weblog from
    Thomas Jung.
    /people/thomas.jung3/blog/2004/11/17/bsp-a-developers-journal-part-xiv--consuming-webservices-with-abap
    But when i try to test the proxy in SE80 I retrieve the following error:
    <CODECONTEXT>http://www.sap.com/xml_errorcodes</CODECONTEXT>
      <CODE>SOAP:111</CODE>
      <ERRORTEXT>Unallowed RFC-XML Tag (SOAP_EINVALDOC)</ERRORTEXT>
    What's wrong here? Someone can help me?
    Thanks for your help!
    Klaus

    We had the same error message for one of our Proxy Web Service calls.
    We tried to use an RFC instead of the URL, and performed a TEST CONNECTION.  And low and behold, we received an error message that was much more helpful than the "Unallowed RFC-XML Tag (SOAP_EINVALDOC)" message.
    The problem for us was that the Server that we were trying to consume the Web service from was blocking the IP address of our Web Application Server.
    We contacted the administrator, he verified that was the case, removed the restriction, and all is good now.
    Here was the message we saw when we tested it in the RFC:
    The Web server you are attempting to reach has a list of IP addresses that are not allowed to access the Web site, and the IP address of your browsing computer is on this list.  Please try the following: Contact the Web site administrator if you believe you should be able to view this directory or page.
    Hope this helps!

  • Consuming SAP web services with tables

    I'm doing kind of feasibility study on consuming SAP web
    services from CF.
    So far so good, but I'm stuck dealing with tables
    (import/export parameters in SAP world).
    I know how to receive a table object from SAP functions:
    * With Apache Axis v1.2: pass an empty CF structure as a
    parameter
    * With Apache Axis v1.4: pass an empty CF array as a
    parameter
    Then the parameter is filled with data (replaced with Java
    object) and we can just parse the object accordingly.
    My question here is whether or not we can pass a *table with
    actual records*.
    For example, I want to pass a table with multiple records to
    update DB records under SAP.
    I tried passing (1) CF array of structure and (2) Java
    ArrayList with no chance.
    The web service call itself completes without errors (no
    method signature error), but the SAP function seems to see the
    parameter as an empty table.
    Anyone has been successful with this case?
    Any suggestion would be much appreciated.

    Thanks Dan,
    Unfortunately CF query object didn't work either.
    Now I'm looking at the code generated by Flex Builder to see
    how the classes are like ;-)
    It's just an ArrayCollection of simple value objects
    (representing a row).
    So CF array of structure or Java ArrayList looks a reasonable
    approach though they don't at all.

  • Consuming Domino web service with JAXB encounters Method Response element

    I am able to consume a Domino R7 (Axis) web service with JAX-WS using Dispatch<SOAPMessage>. When I try using Dispatch<Object> however, JAXB throws an exception because it encounters an unexpected tag.
    The XML from the web service looks like this:
    <Envelope>
        <Body>
            <WebServiceMethodResponse>
                <WebServiceMethodReturn>
                    The meaning of life
                </WebServiceMethodReturn>
            </WebServiceMethodResponse>
        </Body>
    </Envelope>With Dispatch<SOAPMessage>, I can get to the meaning of life quickly using SOAPBody.getElementsByTagName( "WebServiceMethodReturn" ) but with Dispatch<Object>, it appears I must also create a class for the WebServiceMethodResponse element to make JAXB happy. I don't see this happening in other people's examples. Has the Return-element-within-Response-element design been eliminated in pure JAX-WS web services, or is this something that only IBM does?

    In case anyone's search leads them here, I've posted the solution at:
    *[http://www.pby.com/general.nsf/webarticles/dominowebservice01]*
    It is an exhaustive article (not "Hello World"!) that goes through several versions of the web service and client - hopefully explaining all+ pieces of the puzzle:
    ~ web service code,
    ~ WSDLs
    ~ schema
    ~ thoroughly-documented clients that do and do not use JAXB
    ~ ... that use generated artifacts
    ~ ... that customize existing POJOs
    ~ the SOAP messages generated in each direction
    ~ the necessary JAXB annotations
    ~ explanations of how the code works
    ~ explanations of how namespaces affect the code
    ~ on and on and on...
    My constant goal was to write an uncomplicated solution that uses as few artifacts (two) and annotations as possible. The end result is a small, fast JAX-WS 2.0 client that uses JAXB to invoke and consume a secured Domino 7 (1.4.2 JVM + AXIS) web service, using RPC/literal SOAP messages.

  • Invoking a AXIS Web Service with a Java object as input argument

    Hi
    I've been trying to execute a bpel process that invokes a web service deployed through axis.
    This web service takes a java object as input argument as opposed to data types that are directly mapped to java types through the SOAP engine.
    I deployed and tested the service outside of BPEL using a test client class. Everything works well.
    When I try to configure the "Assign" and "Invoke" activities so that service can be invoked, I cannot see the data structure through the variable picker and I see the following message:
    "The element {urn:ComplexTypeWebService}TimeSheetBean is not know to the schema container. Perhaps a schema file that uses it needs to include or import its definition.There mat also be an XML schema issue (non resolvable schema) which prevents {urn:ComplexTypeWebService}TimeSheetBean from being seen by the schema processor."
    Is there any example that demonstrates how to invoke an axis web service in such scenario? What am I doing wrong?
    Please, let me know.

    The passing of Java objects in and out of a web service is NOT supported. variables must be xml documents defined by a XML schema. In my opinion, missing Java object and WSDL is not a good idea. -Edwin

  • Consuming a Web Service with ABAP in WAS 6.40 (SS3)

    Hi Everyone,
         Has anyone successfully consumed a web service (based on an EJB) that is published to the J2EE engine of their WAS 6.40 server by creating a proxy from the ABAP layer?
         We are encountering the following problem: When executing method of the proxy to call the Web Service on the J2EE engine, the CX_AI_SYSTEM_FAULT exception is triggered with the message "Unallowed RFC-XML Tag (SOAP_EINVALDOC)".
         This same problem has occurred with multiple web services, even though the proxy generation seems to execute without a problem.  Is there some system setting that could cause this?  We have run the SOAP Runtime trace, but only receive the same basic information about the problem.
         If anyone has any thoughts at all, I'd be grateful to hear them.
         Thanks,
            --Greg

    Hi,
    We encountered problems when consuming a foreign WS. It seems to be that RPC style WSDL isn't supported by the WAS 6.4 WS proxy. An interesting reading on this is
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/the difference between rpc and document style wsdl.article
    Eddy

  • Consuming  a Web Service with PasswordDigest Authentication in ABAP

    Hello,
    I need to consume a web service in ABAP from a non-SAP application. The web service uses wsse:UsernameToken with PasswordDigest in the SOAP Header for authentication. However, I havent seen any documentation for using Password Digest in ABAP.
    Is it possible to use Password Digest in ABAP?
    Thanks
    Ajay

    Hi Marc,
    Here is the ABAP Code to build the SOAP header.
    FUNCTION Z_GET_SOAP_REQUEST_HEADER.
    *"*"Local Interface:
    *"  EXPORTING
    *"     VALUE(ER_SECURITY_ELEMENT) TYPE REF TO  IF_IXML_ELEMENT
    *date and time data
      data: lv_sys_date like sy-datum,
            lv_sys_time like sy-uzeit,
            lv_year(4) type c,
            lv_month(2) type c,
            lv_date(2) type c,
            lv_hour(2) type c,
            lv_min(2) type c,
            lv_sec(2) type c.
      data : lv_created type string,
            lv_snonce type string,
            lv_b64nonce type string,
            lv_webservice_password type string,
            lv_webservice_userid type string,
            lv_spassword type string,
            lv_xpassword type xstring,
            lv_hpassword type hash160x,
            lv_b64password(255) type c,
            lv_xpasslen type i,
            lv_hpasslen type i.
    *xml declartions
      data : lv_sheader type string,
            lv_xheader type xstring,
            xml_document TYPE REF TO if_ixml_document,
            xml_root TYPE REF TO if_ixml_element,
            xml_element TYPE REF TO if_ixml_element,
            xml_node TYPE REF TO if_ixml_node.
    *get the c-link password.
    CALL METHOD ZCL_CDB_SYNC_CFG_READER=>GET_USERID_PASSWORD
      IMPORTING
        EV_USER_ID  = lv_webservice_userid
        EV_PASSWORD = lv_webservice_password
    *Evaluate created date time
      lv_sys_date = sy-datum.
      lv_sys_time = sy-uzeit.
      lv_year = lv_sys_date(4).
      lv_month = lv_sys_date+4(2).
      lv_date = lv_sys_date+6(2).
      lv_hour = lv_sys_time(2).
      lv_min = lv_sys_time+2(2).
      lv_sec = lv_sys_time+4(2).
      CONCATENATE lv_year '-' lv_month '-' lv_date 'T' lv_hour ':' lv_min ':' lv_sec '.000Z' into lv_created.
    *Create and encode the nonce
      CALL FUNCTION 'GENERAL_GET_RANDOM_STRING'
        EXPORTING
          NUMBER_CHARS  = 24
        IMPORTING
          RANDOM_STRING = lv_snonce.
      CALL METHOD cl_http_utility=>ENCODE_BASE64
        EXPORTING
          UNENCODED = lv_snonce
        RECEIVING
          ENCODED   = lv_b64nonce.
    *create the password to be sent to web service
      CONCATENATE lv_snonce lv_created lv_webservice_password into lv_spassword.
    *encode password to xstring
      CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
        EXPORTING
          TEXT   = lv_spassword
        IMPORTING
          BUFFER = lv_xpassword.
      lv_xpasslen = xstrlen( lv_xpassword ).
      CALL FUNCTION 'CALCULATE_HASH_FOR_RAW'
        EXPORTING
          ALG      = 'SHA1'
          DATA     = lv_xpassword
          LENGTH   = lv_xpasslen
        IMPORTING
          HASHX    = lv_hpassword
          HASHXLEN = lv_hpasslen.
      CALL FUNCTION 'SCMS_BASE64_ENCODE'
        EXPORTING
          INPUT            = lv_hpassword
          INPUT_LENGTH     = lv_hpasslen
        IMPORTING
          OUTPUT           = lv_b64password
        EXCEPTIONS
          OUTPUT_TOO_SMALL = 1
          OTHERS           = 2.
      IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * build the header
      CONCATENATE
    '<soap-env:Header xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">'
    '<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">'
    '<wsse:UsernameToken wsu:Id="########" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">'
    '<wsse:Username>'
    lv_webservice_userid
    '</wsse:Username>'
    '<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">'
    lv_b64password
    '</wsse:Password>'
    '<wsse:Nonce>'
    lv_b64nonce
    '</wsse:Nonce>'
    '<wsu:Created>'
    lv_created
    '</wsu:Created>'
    '</wsse:UsernameToken>'
    '</wsse:Security>'
    '</soap-env:Header>'
    INTO lv_sheader.
    *Build the xml header element
      lv_xheader = cl_proxy_service=>cstring2xstring( lv_sheader ).
      TRY.
          CALL FUNCTION 'SDIXML_XML_TO_DOM'
            EXPORTING
              xml           = lv_xheader
            IMPORTING
              document      = xml_document
            EXCEPTIONS
              invalid_input = 1
              OTHERS        = 2.
          IF sy-subrc = 0 AND NOT xml_document IS INITIAL.
            xml_root = xml_document->get_root_element( ).
            er_security_element ?= xml_root->get_first_child( ).
            gr_soap_security_header = er_security_element.
          ENDIF.
        CATCH cx_ai_system_fault .
      ENDTRY.
    ENDFUNCTION.

  • Web service with complex java type

    Hi,
    I create a web service method with String o with Array of Strings without problem. Now I nedd to create a ws that return a table, so I create a class like this:
    public class User {
         private String Name;
         private String.Surname;
         public void setName(String setName){
              Name= setName;
         public void setSurname(String setSurname){
              Surname=setSurname;
    In my ws class I use this object:
    public User[] getUser(String a){
              User[] user = new User[10];
              for (int i=0;i<10;i++){
                   User<i>.setName("aaa");
                   User<i>.setSurname("bbb");
              return user;
    When in WebService Perspective I try to create my ws in wizard mode I see method getUser but I can't check it
    Where is error?
    Thanks
    Andrea

    HI Andrea,
        I think with present netweaver developer studio , we can create Web services with end points as simple data types in java and the array of that simple data types.
        not sure whether it support our own custom developed classes as end points.
         just go through these links.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/f7/af60f2e04d0848888675a800623a81/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/f7/af60f2e04d0848888675a800623a81/frameset.htm
    from this we will get Restrictions for WS Endpoints.
                             Regards
                              Kishor Gopinathan

  • Exporting to Microsoft Excel from a DataView Web Part consuming a Web Service with Parameters

    In Sharepoint Designer, I've developed a page displaying a DataView Web Part which consumes an XML Web Service with three parameters.  These parameters are passed in from a simple Form Web Part containing three input fields.  I am able to provide default values for the web service so the dataview is initially populated, and when I enter in new parameters, the web service goes back, grabs the requested data and displays in the dataview nice and slick.
    The problem I'm having is this: In Internet Explorer 7, when I right-click on the DataView Web Part and select Export to Microsoft Excel, Excel opens up, says "ExternalData_1: Getting Data..." and returns the data from the web service which applies to the default parameter values each and every time, regardless of whether I have changed the parameters on the web page, and contrary to what the DataView Web Part displays on the screen.
    Has anyone else run into this, and is there a solution to the problem?
    Best regards,
    Mark Christie

    Hi Bullish35,
     It's possible to provide single export button and export your 4 dataview webparts. Here's the modified code.
    <Script Language="Javascript">
    function isIE() // Function to Determine IE or Not
    return /msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent);
    function exportToExcel() // Function to Export the Table Data to Excel.
    var isIEBrowser = isIE();
    if(isIEBrowser== false)
    alert('Please use Internet Explorer for Excel Export Functionality.');
    return false;
    else
    var strTableID1 = "detailsTable1", strTableID2 = "detailsTable2", strTableID3 = "detailsTable3", strTableID4 = "detailsTable4";
    var objExcel = new ActiveXObject("Excel.Application");
    var objWorkBook = objExcel.Workbooks.Add;
    var objWorkSheet = objWorkBook.Worksheets(1);
    var detailsTable = document.getElementById(strTableID1);
    var intRowIndexGlobal= 0;
    for (var intRowIndex=0;intRowIndex<detailsTable1.rows.length;intRowIndex++)
    for (var intColumnIndex=0;intColumnIndex<detailsTable1.rows(intRowIndex).cells.length;intColumnIndex++)
    if(intColumnIndex != 3)
    objWorkSheet.Cells(intRowIndexGlobal+1,intColumnIndex+1) = detailsTable1.rows(intRowIndex).cells(intColumnIndex).innerText;
    intRowIndexGlobal++;
    for (var intRowIndex=0;intRowIndex<detailsTable2.rows.length;intRowIndex++)
    for (var intColumnIndex=0;intColumnIndex<detailsTable2.rows(intRowIndex).cells.length;intColumnIndex++)
    if(intColumnIndex != 3)
    objWorkSheet.Cells(intRowIndexGlobal+1,intColumnIndex+1) = detailsTable2.rows(intRowIndex).cells(intColumnIndex).innerText;
    intRowIndexGlobal++;
    for (var intRowIndex=0;intRowIndex<detailsTable3.rows.length;intRowIndex++)
    for (var intColumnIndex=0;intColumnIndex<detailsTable3.rows(intRowIndex).cells.length;intColumnIndex++)
    if(intColumnIndex != 3)
    objWorkSheet.Cells(intRowIndexGlobal+1,intColumnIndex+1) = detailsTable3.rows(intRowIndex).cells(intColumnIndex).innerText;
    intRowIndexGlobal++;
    for (var intRowIndex=0;intRowIndex<detailsTable4.rows.length;intRowIndex++)
    for (var intColumnIndex=0;intColumnIndex<detailsTable4.rows(intRowIndex).cells.length;intColumnIndex++)
    if(intColumnIndex != 3)
    objWorkSheet.Cells(intRowIndexGlobal+1,intColumnIndex+1) = detailsTable4.rows(intRowIndex).cells(intColumnIndex).innerText;
    intRowIndexGlobal++;
    objExcel.Visible = true;
    objExcel.UserControl = true;
    </Script>
    I haven't tested this. But it should work! :)Regards,
    Venkatesh R
    /* My Code Runs in Visual Studio 2010 */
    http://geekswithblogs.net/venkatx5/

  • Consuming a web service with header

    Hi
    I am trying to consume a web service in BIP.
    But the problem is that the authentication is in the header of the SOAP, it does not take the values provided in username/password field in complex type service.
    (However i am able to see the methods in the body of the web service.)
    hence i get an error "username not specified"
    how do i pass the credentials in the header of the soap?
    I am using BIP 10.1.3.4

    This is the output at the oc4j when I try to execute:
    After WSS soapMessage = <soap:Envelope xmlns:soap="http://sche
    mas.xmlsoap.org/soap/envelope/">
    *<soap:Header></soap:Header>*
    <soap:Body xmlns:ns1="urn:XYZ_Request">
    <ns1:OpGet>
    <ns1:Request_ID>000000000000019</ns1:Request_ID>
    </ns1:OpGet>
    </soap:Body>
    </soap:Envelope>
    Notice that Header is null. I want to pass the authentication in the header.

  • Consuming a web service with an applet...

    Hi, Ive created an applet in netbeans 5.5, which consumes a web service - it works 100% "run file" in the ide, but when i look at it via web browser, it seems the webservice object cannot be instantiated. I'm guessing I need to somehow include jax-ws objects in my deployment, but how do I do this? - I'm a little out of my depth here, so please explain thoroughly
    Thanks

    Hi,
    We encountered problems when consuming a foreign WS. It seems to be that RPC style WSDL isn't supported by the WAS 6.4 WS proxy. An interesting reading on this is
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/the difference between rpc and document style wsdl.article
    Eddy

  • Not able to receive the web service response to java client - jax-rpc

    HI,
    Have a wsdl and created the java client using wscompile and got the set of files (Port, Binding, ServiceLocator, Service and all related java files).
    My java client sends the valid java request to the webserver and i could see the correct response coming back to my machine as the reply from the webserver.
    But i couldnt get the response printed using System.out.println in my java client when i invoke call.invoke() method with needed input parameters.
    Do i need to set any encoding or how do i get the response in the my java client which is returned from the webserver?

    The whole PL/SQL which fails in case it helps to solve the issue
    declare
    peticion VARCHAR2(32767);
    env VARCHAR2(32767);
    url varchar2(1000);
    http_req utl_http.req;
    http_resp utl_http.resp;
    begin
    url:='http://<HOST>:7778';
    -- soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    -- <auth:BasicChallenge
    -- xmlns:auth="http://www.soap-authentication.org/2002/01/">
    -- <Realm>Oracle Calendar Web Services</Realm>
    -- </auth:BasicChallenge>
    peticion:='
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Header>
    <auth:BasicAuth xmlns:auth="http://soap-authentication.org/2002/01/">
    <Name>sysadmin</Name>
    <Password>sysadmin1</Password>
    </auth:BasicAuth>
    </soap:Header>
    <soap:Body>
    <cwsl:Create xmlns:cwsl="http://www.oracle.com/WebServices/Calendaring/1.0/">
    <CmdId>Testoraptor Command 31</CmdId>
    <iCalendar>
    <vcalendar prodid="-//Oracle//Calendaring//Calendarlet//EN" version="2.0">
    <vevent>
    <class>PUBLIC</class>
    <description>a long description</description>
    <dtstart>20061003T090909</dtstart>
    <duration>60M</duration >
    <location>my location</location>
    <priority>2</priority>
    <summary>a title</summary>
    <uid>4567</uid>
    <x-oracle-eventtype>APPOINTMENT</x-oracle-eventtype>
    </vevent>
    </vcalendar>
    </iCalendar>
    </cwsl:Create>
    </soap:Body>
    </soap:Envelope>';
    http_req := utl_http.begin_request(url||'/ocws-bin/ocas.fcgi', 'POST','HTTP/1.0');
    utl_http.set_header(http_req, 'Content-Type', 'text/xml');
    utl_http.set_header(http_req, 'Content-Length', length(peticion));
    utl_http.set_header(http_req, 'SOAPAction', '"http://www.oracle.com/WebServices/Calendaring/1.0/Create"');
    utl_http.write_text(http_req, peticion);
    dbms_output.put_line (length(peticion));
    http_resp := utl_http.get_response(http_req);
    utl_http.read_text(http_resp, env);
    utl_http.end_response(http_resp);
    end;
    We have tried many different XML structures but we are not able to create an appointment.

  • Problem in accessing the Web Service using standalone Java Client

    Dear Friends,
    Hi,
    I have an active web service and I have tested the same with XML Spy and Apache Axis and is giving me the output perfectly. For the same, I have developed a standalone Java client but getting problem in fetching the output.
    The Exception is :
    <Jan 4, 2006 5:54:16 PM GMT+05:30> <Info> <WebService> <BEA-220025> <Handler weblogic.webservice.core.handler.ClientHandler threw
    an exception from its handleResponse method.
    The exception was:
    javax.xml.rpc.JAXRPCException: java.io.IOException: Received a response from url: http://10.20.15.59:18004/amountToWords which did
    not have a valid SOAP content-type: text/html;charset=ISO-8859-1. .>
    SOAP Fault **************** Exception during processing: java.io.IOException: Received a response from url: http://10.20.15.59:18
    004/amountToWords which did not have a valid SOAP content-type: text/html;charset=ISO-8859-1.
    (see Fault Detail for stacktrace)
    javax.xml.rpc.soap.SOAPFaultException: Exception during processing: java.io.IOException: Received a response from url: http://10.2
    0.15.59:18004/amountToWords which did not have a valid SOAP content-type: text/html;charset=ISO-8859-1.
    (see Fault Detail for sta
    cktrace)
    at weblogic.webservice.core.ClientDispatcher.receive(ClientDispatcher.java:313)
    at weblogic.webservice.core.ClientDispatcher.dispatch(ClientDispatcher.java:144)
    at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:457)
    at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:443)
    at weblogic.webservice.core.rpc.CallImpl.invoke(CallImpl.java:566)
    at weblogic.webservice.core.rpc.CallImpl.invoke(CallImpl.java:419)
    at HelloClient.main(HelloClient.java:100)
    I have tried some ways to set the content type explicitly but the results are same(throwing an exception).
    I appreciate you all for helping me out of this.
    Thanks
    VR

    Hi Amit
    We also have this issue with weblogic webservices. Did you get any resolution for this issue.
    When the service is executed for lesser number of hits, all the responses are processed properly. But as load (Number of hits for the same service) increases, few responses are failed to be parsed in the web service client. We could confirm that the producer responds with proper content type (text/xml)
    Any help or pointers will be greatly appreciated.
    Thanks,
    Finny

Maybe you are looking for