Consuming SOAP services from AIR/HTML (JavaScript).

Hi All.
I am trying to consume SOAP web services from an AIR/HTML application for a research on AIR I am doing for my company, and I am having very little success.
I am creating JavaScript clients using apache's cxf wsdl2js utility.
When I try to use the client to call any web service I've tried, I always get an 'error 500' response.
The web services work fine if i call them from other clients.
Before trying cxf generated clients I googled a lot to see if there was a more native way of doing these calls from AIR, but found nothing. I don't see anything in documentation or the web about it.
Am I the only one trying this?
Could this be a cross-domain issue? I'm certainly hoping AIR apps don't have this issue.
Any pointers as to how to succesfully consume SOAP services from AIR is greatly appreciated.
Thanks!

In Visual Basic, you can set Network Credentials like this (assuming that you first declare Public CallWebService001 As New <WebReference>):
        ' Create a new instance of CredentialCache.
        Dim mycredentialCache As Net.CredentialCache = New Net.CredentialCache()
        ' Create a new instance of NetworkCredential using the client
        ' credentials.
        Dim credentials As Net.NetworkCredential = New Net.NetworkCredential(<username>, <password>)
        ' Add the NetworkCredential to the CredentialCache.
        mycredentialCache.Add(New Uri(CallWebService001.Url), "Basic", credentials)
        ' Add the CredentialCache to the proxy class credentials.
        CallWebService001.Credentials = mycredentialCache

Similar Messages

  • Bug in navigateToURL? (AIR HTML/JavaScript) window name parameter not working

    Hi,
    I have to popup the default browser from a HTML/JavaScript application.
    All links on the Air page should be opened in the same tab in the same browser window that was opened by the first click on a link.
    The code I use is
    var urlString = "http://www.adobe.com";
    var request = new air.URLRequest(urlString);
    air.navigateToURL(request, "myNewWindow");
    The myNewWindow parameter does not seem to be taken into account:  a new tab is opened on every click.
    I created a new Air application in Aptana and added the following straightforward code to it:
    <html>
        <head>
            <title>navigateToURLTest</title>
            <script type="text/javascript" src="lib/air/AIRAliases.js"></script>       
        </head>
        <body>   
    <a href="http://www.google.com"
                onclick="javascript:air.navigateToURL(new air.URLRequest('http://www.adobe.com'), 'AirTestWindow');return false;">New Tab</a>
            <br />
            <a href="http://www.adobe.com"
                onclick="javascript:air.navigateToURL(new air.URLRequest('http://www.adobe.com'), 'AirTestWindow');return false;">Same Tab</a>
        </body>
    </html>
    Same problem.
    Does anyone have any idea?
    Thanks

    Is there really nobody who can answer or at least try to reproduce this? 
    It's just creating a new Air HTML/Javascript application with one link with a named window target!

  • Invoke OSSO protected SOAP service from composite

    Hi,
    I would like to invoke an OSSO protected SOAP Service from a composite. I haven't been able to figure out how exactly to invoke the service properly, and I end up with
    javax.xml.soap.SOAPException: Bad response: 401 Unauthorized
    or
    oracle.j2ee.ws.saaj.ContentTypeException: Not a valid SOAP Content-Type: text/html; charset=iso-8859-1
    This is because the OSSO Server is trying to redirect the request to a login page.
    I have attempted to configure the service reference to use the following, but I fear this will only work for basic http authentication
    <property name="oracle.webservices.auth.password">password</property>
    <property name="oracle.webservices.auth.username">username</property>
    and added the following the the reference and configure the credential store csf-key and basic.credentials to have a username / password.
    <wsp:PolicyReference URI="oracle/wss_username_token_client_policy"
    orawsp:category="security" orawsp:status="enabled"/>
    Can anyone provide any insight on this?
    Thanks,
    Ben

    One more update i tried printing l_http_response.status_code and got 302.
    Thanks,
    PKV

  • Error consuming Web service from an ABAP Program

    Hello guys,
    I'm trying to consume a Web Service that is exposed in the internet. The conecction to the Web Service its via SSL.
    I'm having a problem at the moment I call the web service from my abap program.  But I'm able to test the same web service, from the SE80 tx with out trouble.
    I have identify that there is a difference in the SOAP envelope, that its received in the Web service, when I call it from the test enviorment and when I call it from the program. 
    This is how it is received from the TEST tool (a succesfull call of th WS) :
    <soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
    <soap-env:Header><n0:Trace xmlns:n0="http://www.sap.com/webas/630/soap/features/runtime/tracing/"><TraceLevel xmlns="http://www.sap.com/webas/630/soap/features/runtime/tracing/">Error</TraceLevel></n0:Trace></soap-env:Header><soap-env:Body><nr1:putXMLDocument xmlns:nr1="http://bel.bci.cl/WsBEL/services/Carga"><body>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;&lt;Mensaje&gt;&lt;RutEmpresa&gt;&lt;Numero&gt;76555400&lt;/Numero&gt;&lt;Digito&gt;4&lt;/Digito&gt;&lt;/RutEmpresa&gt;&lt;RutUsuario&gt;&lt;Numero&gt;12307972&lt;/Numero&gt;&lt;Digito&gt;8&lt;/Digito&gt;&lt;/RutUsuario&gt;&lt;Convenio&gt;58422&lt;/Convenio&gt;&lt;Pin&gt;aro79728&lt;/Pin&gt;&lt;Archivo&gt;&lt;Tipo&gt;PPR&lt;/Tipo&gt;&lt;Plantilla&gt;2142970592&lt;/Plantilla&gt;&lt;Nombre&gt;cargatest174.txt&lt;/Nombre&gt;&lt;Cuerpo&gt;&lt;![CDATA[G126919727     JORGE CRISTIAN VARGAS ROMERO                                                     0000VVC01600000000000000000000245FAC0000000089900032000021030000010000000000190000   2910200714082008Boletas honorarios|]]&gt;&lt;/Cuerpo&gt;&lt;/Archivo&gt;&lt;Fecha&gt;20080814&lt;/Fecha&gt;&lt;/Mensaje&gt;</body></nr1:putXMLDocument></soap-env:Body></soap-env:Envelope>
    And this is how  it is received when I consume the web service from the ABAP program.
    <soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
    <soap-env:Header><n0:Trace xmlns:n0="http://www.sap.com/webas/630/soap/features/runtime/tracing/"><TraceLevel xmlns="http://www.sap.com/webas/630/soap/features/runtime/tracing/">Error</TraceLevel></n0:Trace></soap-env:Header><soap-env:Body><nr1:putXMLDocument xmlns:nr1="http://bel.bci.cl/WsBEL/services/Carga"><body>&lt;?xml version="1.0" encoding="utf-8" ?&gt;&lt;nr1:putXMLDocument xmlns:nr1="http://bel.bci.cl/WsBEL/services/Carga"&gt;&lt;body&gt;&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;&lt;Mensaje&gt;&lt;RutEmpresa&gt;&lt;Numero&gt;76555400&lt;/Numero&gt;&lt;Digito&gt;4&lt;/Digito&gt;&lt;/RutEmpresa&gt;&lt;RutUsuario&gt;&lt;Numero&gt;12307972&lt;/Numero&gt;&lt;Digito&gt;8&lt;/Digito&gt;&lt;/RutUsuario&gt;&lt;Convenio&gt;58422&lt;/Convenio&gt;&lt;Pin&gt;aro79728&lt;/Pin&gt;&lt;Archivo&gt;&lt;Tipo&gt;PPR&lt;/Tipo&gt;&lt;Plantilla&gt;2142970592&lt;/Plantilla&gt;&lt;Nombre&gt;cargatest174.txt&lt;/Nombre&gt;&lt;Cuerpo&gt;&lt;![CDATA[G126919727 JORGE CRISTIAN VARGAS ROMERO 0000VVC01600000000000000000000245FAC0000000089900032000021030000010000000000190000 2910200714082008Boletas honorarios|]]&gt;&lt;/Cuerpo&gt;&lt;/Archivo&gt;&lt;Fecha&gt;20080814&lt;/Fecha&gt;&lt;/Mensaje&gt;&lt;/body&gt;&lt;/nr1:putXMLDocument&gt;</body></nr1:putXMLDocument></soap-env:Body></soap-env:Envelope>
    As you can see, it is generating a nr1:putXMLDocument tag, that it should not go there.
    Why do you think that this situation is happening? Please guys, this is very important, and need your help.  Thanks in advance.
    Samuel.

    BSP a Developer's Journal Part XIV - Consuming WebServices with ABAP
    Calling WebServices from ABAP via HTTPS
    Consuming Web Service from ABAP by Durairaj Athavan Raja
    Search on SDN wiki, and you will find above mentioned links.

  • Consuming SOAP service

    Hello All,
    In my application I am consuming SOAP service by Schema Project -> Right Click -> Add Generated Items.
    This Add Orchestrations, Binding, Schema to my Project.
    Now in Schema I can see :
    GetApplicationDeatial
    CandidateID -> string
    GetApplicationDeatialResponse
    CandidateName -> string
    CandidateNumber -> string
    GetAllRefrenceData
    GetAllRefrenceDataResponse
    GetAllRefrenceDataResult
    KeyValueOfintstring
    Key int
    Value string
    In my application controller will call BizTalk hosted service and will send query to BizTalk BizTalk will call Database service and will fire query on database and response will be again send back to controller.
    GetApplicationDetail is method name and having parameter name candidateID I will create schema for this and will create Map
    and will call this schema and maps in orchestration to send the query to database service the response will capture in method name GetApplicationDeatialResponse and will create one more schema and map and will handle the response back.
    There is as method named GetAllRefrenceData this method is not having any child node and database service will fire query on one Table referencedata ( select * from referencedata ) how to handle this ? how send request to Database service ? what will be
    scheam and map for this ?
    The replay of this request will be handle by method GetAllRefrenceDataResponse which will contain index of referenceData in it.
    Thanks, Nitin
    Thanks and Regards, Nitin.

    So its easy to achieve it . What basically you need to consume the.Net hosted Database service first .
    There are multiple of articles which can help you to guide "How to consume web service/WCF service in BizTalk" some of them are listed below
    Consuming WCF service in Orchestration in BizTalk
    Consuming WCF Service in BizTalk 2010 Orchestration
    BizTalk and WCF: Part I, Operation Patterns
    Once you have successfully consumed and created the Orchestration ,you have option to expose Orchestration or schema as WCF service.

  • Windows authentification while consuming web service from ABAP

    Hi All,
    We are consuming web service from ABAP, we have created client proxy in SE80 and configured logical port in LPCONFIG.
    This one was working fine. Now we have added  windows user authentification to access this service.
    Now when I'm trying to regenerate this proxy in R/3 it is asking for user and password. When I enter these details this one is not working.
    If I access this service direcly from internet explorer and I enter same user and password then I would able to access this service.
    Could you please let me know how to handle this.
    Regards
    Vikram

    The dialog that is produced by HTTP Destination object of the logical port is designed only for use within Classic Dynpro applications.  There is no prompt produced when running in Web Dynpro.  If possible assign a generic user within the logical port definition and this will be used automatically by all users.

  • How to consume WEB SERVICES from ABAP ??

    Q: How to consume WEB SERVICES from ABAP program??
         the point here is i am using SAP release 620 and the creation of proxy is out of scenario
         and also no XI.    Its only through ABAP program i need to consume one web service (its a HTTPS one ),
        Using cl_http_client... i tried it but i am totally confused of whats happening ???
    Req some senior ppl advice on the same/approach.
    any hints will suffice my way of approach...!!!
    Please do put in your valuable advices..!!
    Thanks in advance..!!!!

    Hello Srinivas,
    Following is the code for calling web service:
    data: client type ref to if_http_client,
          host   type string value 'server url',
          service type string value '8080',
          path type string value '/sap/public/ping',
          errortext type string,
          proxy_service type string,
          scheme type i value 1.
    call method cl_http_client=>create
    exporting host  = host
            service  = service
         proxy_host  = host
       proxy_service = service
       scheme        = scheme
    importing client  = client
    exceptions
        argument_not_found = 1
        internal_error     = 2
        plugin_not_active  = 3
        others             = 4.
    case sy-subrc.
      when 0.
         write 'Server reached successfully'.
      when others.
         write: 'sy-subrc =', sy-subrc.
    endcase.
    Once you got the client object you can call following methods:
    "Set the requrie URL for the web service you want to call. This is not WSDL anyway!!
    cl_http_utility=>set_request_uri( request = client->request
    uri =' url 2 be called ').
    *Then you can call send method with proper inputs for sending request to WS
    CALL METHOD client->send
    Then you can use receive method for getting the response
    CALL METHOD client->receive
    *You can get last error in case of exceptions
    CALL METHOD cl_http_client=>get_last_error
    *Close the client object
    CALL METHOD client->close
    For more information on full code refer my link in previous replay.
    Thanks,
    Augustin.
    Edited by: Augustarian on Aug 18, 2009 1:49 PM

  • Consume web service from a PAR file

    Hi All,
    Is it possible to consume web service from a PAR file? If yes, can you please give me an example / link.
    Appreciate your help.
    Thanks,
    Vimukta

    << Do not post the same question across a number of forums >>

  • How can I run a .bat file from an html/javascript adobe air installation package?

    I write an html/javascript code which works completely true
    but when I made the installation package by air-sdk
    it dosent work properly
    my code is:
    <html>
    <head>
        <title>Hello World</title>
              <script type="text/javascript">
            function appLoad() {
                air.trace("Hello World");
        </script>
    </head>
    <body onLoad="appLoad()">
        <h1>Hello World</h1>
              <br />
    <button onclick="window.open('file:///C:/Windows/notepad.exe')"> Launch notepad </button>
    <button onclick="window.open('file:///D:/opennotepad.bat')"> Launch batnote </button>
    </body>
    </html>
    Chapter 5: Creating your first HTML-based AIR application with the AIR SDK

    Seems to be security violation. You can't execute bat or cmd

  • Error while consuming Odata service from Gateway client i.e /iwfnd/gw_client

    Hello Experts.
       I am facing below an error while consuming the Odata service from GW client... The error is "No service found for the namespace /IWFND/,name ZTEST_STOREROOM_SRV,version 001". Even i have tried to deep dive in /IWFND/Error_log but no use..
      Actually what I was doing :- My aim is to connect multiple back end systems in the same server with the help of Aliasing concept.. I have created multiple aliases and added in the /IWFND/MAINT_Service transaction.. but i am not getting how to consume the service..
       I have followed the solution upto some extent in the link => Multiple Origin Composition - SAP NetWeaver Gateway Foundation (SAP_GWFND) - SAP Library
      Can you please let me know how to resolve this.. Also please let me know, the syntax for the URI...
      Your help is highly appreciated..
      Please find the screenshot attached.
    Thanks,
    Srinivas.

    Hello @Nrisimhanadh_Yandamuri
      Thanks for your reply..
      I have got all the required authorization.. But still I am not able to hit the service.. Please let me know what could be the solution..
    Thanks,
    Srinivas.

  • Problem in consuming web service from esworkplace

    Hello
    I am useing CE7.2 evaluation version
    I want to consume a web service from SAP workplace
    I've built a process composer project then I tried to import a WSDL and chose the "service registry" option
    However I keep getting  the message "internal error in the services registry"
    BTW u2013 I defined the "esworkplace" as the services registry in the Preferences.
    Any ideas what can be the problem? Thanks.
    Thanks

    Hi Experts,
    Please help me with this issue. I am really stuck up here.
    Thanks,
    Radhika

  • 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.

  • Unable to consume Enterprise services from Visual Composer

    Hi,
    We have implemented ECC-SE 603 add-on in our ECC 6.0 system.
    We configured to set up a connection between our J2EE engine and the ES Workplace, to consume the Enterprise services from Visual Composer.
    But, we are unable to see the Enterprise Services in the Visual Composer.
    Kindly, let us know how to resolve this issue.

    Hi,
    please refer the following link
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a160392c-0e01-0010-7784-9cc564d871d2
    Regards
    Manohar

  • Consuming web service from Lotus Domino with ABAP

    Hello,
    I'm trying to consume a web service from our Domino Server.
    I was able to create a Client Proxy by entering the URL to the WSDL (http://lntraining/taxs/taxscontroltrg.nsf/GBU_Transfer?WSDL).
    When I try to consume the web service I get the message "No such operation 'GETGBUDATARequest'" with SoapFaultCode:1.
    I assume that SAP has a problem with the URL of the web service (http://lntraining:80/taxs/taxscontroltrg.nsf/GBU_Transfer?OpenWebService). I think the reason is the query prefix of the URL (?OpenWebService). I tried to add it into the RFC Destination but SAP doesn't allow me to do so.
    Any suggestions or experiences?
    Thx,
    Dennis

    Hi Lavaughn,
       Try maintaining HTTP proxy setting using transaction SM59->RFC->HTTP Proxy Configuration. I suspect your WAS server also need to use proxy server for accessing internet.
    Regards,
    Sanjeev

  • Problem with consuming web service from abap

    Hello,
    I want to consume this web service VatatWebService Web Service From SAP.
    The transaction code soamanager doesn't exist in our system, i'm the only man who use SAP in our company(we don't have BC peoples....).
    I find some advice to use "wsadmin" and "lpconfig", but i do not know the step: wish data i have to fill in in tcode "wsadmin" or "lpconfig".
    I'm very new in this case...
    Is there any doc showing the step to consume a web service?
    Thank u very match.
    Ouail

    Hi,
    Have you tried to search using that magical tool called Google?  If I search for "SAP LPConfig" I get lots of promising looking answers:
    You could also try searching help.sap.com
    I appreciate you are new but one of the best skills you can learn in the world of SAP is how to search out and find information, so you aren't dependant upon SCN and/or others to help you when you get stuck.
    Cheers,
    G.

Maybe you are looking for

  • Use of titles causes excessive CPU usage

    I have been working on a project in PP CC (all latest updates installed) for the past week.  I have had no problems regardless of the increase in size of the project over time.  Yesterday I began adding a few titles.  After I added the titles the app

  • Spry menubar not working correctly in IE9 - fixed width or padding or...?

    Need help.  My spry menu bar isn't all the way to the right when in compatibility mode in IE9.  When not in compatibility mode it is even further from the right.  Is there a way to make it so that it is all the way to the right on both compatibility

  • Black screen/white circles in upper left when testing iPad3 Retina app (Air 3.3)

    I'm developing for iOS, particularly the iPad 3, on Windows. I downloaded the AIR 3.3 SDK and added it to Flash Pro CS6 per this thread: http://forums.adobe.com/message/4583745#4583745 My app runs fine in Air 3.2 but you can't run apps at Retina reso

  • Trouble Testing Server Side Includes using personal web sharing

    I am using the book "Standard complant websites using dreamweaver 8" One of the exercises has me testing that server side includes are enabled by creating two files ssi_test.shtml and hello.html. I have placed these two files in the documents subfold

  • Finding the directory of selected files

    I have selected files in the following manner set new_file to (choose file with prompt "Choose files to save as PDF files.:" with multiple selections allowed) What I now need the the path of the folder these files came from but am not having any luck