How to provide authentication to a caller (Axis Web-Services)

Hi everybody
im a new bie to web services .So,i donno how to provide a user name and password to the client who is consuming my web service.My web server is Tomcat and soap engine is Axis.
Kindly provide me a sample prog(if any) or any links which can help me.
So plz help me as soon as possible.....
Thanks & Regards
Aleem

http://www.w3.org/2002/ws/ <- basics
http://ws.apache.org/axis2/1_2/adv-userguide.html <- there's a security section
edit: I think axis2 comes with a lot of samples, you should check those, too.
regards
slowfly
Edited by: slowfly on 09.04.2009 11:38

Similar Messages

  • Calling AXIS Web Service from a Weblogic Client

    Hi All,
    I am trying to generate a weblogic Web Service cliente (jar) to call an AXIS Web Service. I am using the weblogic ant task <b>clientgen</b> to generate the stubs/classes from WSDL of the AXIS Web Service.
    It creates the the jar but when I try to call the web service it gives the following error:
    <pre>
    java.rmi.RemoteException: SOAP Fault:javax.xml.rpc.soap.SOAPFaultException: org.xml.sax.SAXException: No deserializer defined for array type {http://xml.apache.org/xml-soap}MapItem; nested exception is:
         javax.xml.rpc.soap.SOAPFaultException: org.xml.sax.SAXException: No deserializer defined for array type {http://xml.apache.org/xml-soap}MapItem
    javax.xml.rpc.soap.SOAPFaultException: org.xml.sax.SAXException: No deserializer defined for array type {http://xml.apache.org/xml-soap}MapItem
         at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:498)
         at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:360)
         at weblogic.webservice.core.rpc.StubImpl._invoke(StubImpl.java:244)
         at sample.ProxyService_Stub.genericMethod(Unknown Source)
         at com.orange.few.webservice.test.TestSuiteFijo.testFijo(TestSuiteFijo.java:41)
         at java.lang.reflect.Method.invoke(Native Method)
         at junit.framework.TestCase.runTest(TestCase.java:154)
         at junit.framework.TestCase.runBare(TestCase.java:127)
         at junit.framework.TestResult$1.protect(TestResult.java:106)
         at junit.framework.TestResult.runProtected(TestResult.java:124)
         at junit.framework.TestResult.run(TestResult.java:109)
         at junit.framework.TestCase.run(TestCase.java:118)
         at junit.framework.TestSuite.runTest(TestSuite.java:208)
         at junit.framework.TestSuite.run(TestSuite.java:203)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
    </pre>
    It says that it can´t find the deserializer for the defined array type {http://xml.apache.org/xml-soap}MapItem;
    But in the jar it creates the following clasese:
    <pre>
    org.apache.xml.xml.soap.MapItem
    org.apache.xml.xml.soap.MapItemCodec
    org.apache.xml.xml.soap.MapItemSequenceCodec
    org.apache.xml.xml.soap.holders.MapHolder
    org.apache.xml.xml.soap.holders.MapItemHolder
    </pre>
    and in the mapping file I see the folowing entry:
    <pre>
    <type-mapping-entry deserializer="org.apache.xml.xml.soap.MapSequenceCodec" class-name="org.apache.xml.xml.soap.MapItem[]" xmlns:p3="http://xml.apache.org/xml-soap" type="p3:Map" serializer="org.apache.xml.xml.soap.MapSequenceCodec">
    </type-mapping-entry>
    <type-mapping-entry deserializer="org.apache.xml.xml.soap.MapItemCodec" class-name="org.apache.xml.xml.soap.MapItem" xmlns:p4="http://xml.apache.org/xml-soap" type="p4:MapItem" serializer="org.apache.xml.xml.soap.MapItemCodec">
    </type-mapping-entry>
    </pre>
    Any help would be greatly appreciated,
    Gerardo
    Enviornment:
    Weblogic
    ========
    Weblogic Server: 7.0 SP 4
    OS: Sun Solaris 8
    JDK: 1.3
    AXIS
    ========
    AXIS Version: 1.4
    Container: Tomcat
    OS: Sun Solaris 8
    JDK: 1.4

    Hi Sebastien,
    The wsclient sample loads only a minimal set of SOAP and related jar files to the database required to get the sample working. The SSL related classes may not get resolved correctly, but as the sample does not use these,
    you should still be able to proceed with the setup.
    Can you continue with the configuration steps and let me know if you still face any problems in bringing up the application ?
    HTH
    Sujatha.
    OTN Group.

  • How to see http response from an axis web service call (Eclipse)

    Hello,
    I would like to see the raw http response which is returned from web service calls. I have a dynamic web project in Eclipse which uses a local instance of Tomcat 6. I'm using all of the default setting for a top-down web service generated from a WSDL file. I've generated the client using the built-in "generate client" using default settings.
    I've tried using the Eclipse plugin TCP/IP monitor and apache's TCPMON, but I am only able to see the http request, not the http response returned from the web server I am querying.
    I've seen some sparse documentation outlining how to use logging handlers and a client-config.wsdd file, but I haven't been able to get that working.
    So to recap, I'm looking for a way to view raw http responses using a web service client and server generated from a WSDL file in eclipse. I don't mind creating a new project using different code-generating libraries if someone has an easy way to do this using a different configuration.
    Thanks very much,
    Craig

    908794 wrote:
    Hello,
    I would like to see the raw http response which is returned from web service calls.Why the HTTP response? Isn't the soap message body enough? If it is, you probably want to check out SoapUI.
    A simple google query for "apache axis2 http response" also return this article:
    http://blogs.cocoondev.org/dims/archives/004668.html
    And finally, you did go through the Axis2 website right? It has a wiki with a rather staggering amount of articles in there.
    http://wiki.apache.org/ws/FrontPage/Axis2/

  • CAPS - how to provide two input files for a web service

    Hi,
    We have a web service that takes two parameters. Each of those parameters come from a different file. When we provided two files corresponding to two parameters it reads the first input file but not the second. Can you please tell us how to achieve this.
    Thanks
    -Rao

    Hi,
    In eInsight Business Process under Branching Activities you can select the "Flow Activity", using this acitivity you can achieve the solution for your problem.
    Thanks,
    Madan

  • How to call a web service from BPEL that requires HTTP basic authentication

    Hi All,
    I need to calling some Web Services from BPEL (SOA 10.1.3.1 production running on XP machine). The services require HTTP basic authentication.
    I have tried adding httpUsername and httpPassword properties to the ParnterLink, and I see in BPEL Console that they are deployed by checking the descriptor page. But I still get a SOAP fault, HTTP 401: Unathenticated.
    I have also tried using basicHeaders (from memory) = credentials, httpBasicUsername, and httpBasicPassword. Same result.
    I have done a packet trace using Ethereal, and the headers do not seem to contain the userid and password at all.
    Can anyone help?
    Thanks,
    Mark Nelson

    Thanks Bas,
    I have resolved the issue. The provider of the Web Service had not configured if for Basic Authentication. For some reason it worked when they tested, or maybe the did not test. The only thing I had to change was to use:
    <property name="basicHeaders">credentials</property>
    <property name="basicUsername">WMDATA</property>
    <property name="basicPassword">WMDATA</property>
    Instead of:
    <property name="httpUsername">WMDATA</property>
    <property name="httpPassword">WMDATA</property>
    I don’t know why this is, maybe because it is an Axis Web Service.
    Sorry for wasting your time.
    Regards Pete

  • How can I call external web service from BPEL

    1. I have "EmpService" webservice (simple webservice to get emp salary, not in BPEL domain) running in Oracle AS host1. If I want to call this web service from BPEL in another host2. How can I do this?
    2. Is it a must to deploy this EmpService to Oracle BPEL domain in order to call it? If so, how can I deploy it. As many BPEL example tutorial demonstrate the "obant" command to deploy the BPEL process, but not show how to deploy a external web service not in BPEL project. Please help. ...

    Create a partner link in BPEL and point it to the WSDL deployed on external server.
    this thread will also help
    Axis generated WS to Bpel WS

  • How call a web service WCF pl/sql

    Hi,
    I developed a web services using Visual Studio .NET Framework 4.0, and I need call this web service from Store procedure in Oracle 10g, but I don't have Idea how. I have seen some examples in web but that examples not work when I've used.
    My web service is developed using WCF and It has the address:
    http://10.200.53.250/PeajeElect/Bcac.PeajeElect.Agente_Servicio_ETC.svc
    The config specification is:
    <endpoint address="" binding="basicHttpBinding" contract="Bcac.PeajeElect.IAgente_Servicio_ETC" bindingConfiguration="TheBasicBindingConfig">
    <identity>
    <dns value="localhost" />
    </identity>
    </endpoint>
    Somebody can helppe me, please
    And the wsdl specification is:
    <?xml version="1.0" encoding="utf-8" ?>
    - <wsdl:definitions name="Agente_Servicio_ETC" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:tns="http://tempuri.org/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata">
    - <wsdl:types>
    - <xsd:schema targetNamespace="http://tempuri.org/Imports">
    <xsd:import schemaLocation="http://win-r6ddgayo3y4/PeajeElect/Bcac.PeajeElect.Agente_Servicio_ETC.svc?xsd=xsd0" namespace="http://tempuri.org/" />
    <xsd:import schemaLocation="http://win-r6ddgayo3y4/PeajeElect/Bcac.PeajeElect.Agente_Servicio_ETC.svc?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/" />
    </xsd:schema>
    </wsdl:types>
    - <wsdl:message name="IAgente_Servicio_ETC_ConsultaDeTransacciones_InputMessage">
    <wsdl:part name="parameters" element="tns:ConsultaDeTransacciones" />
    </wsdl:message>
    - <wsdl:message name="IAgente_Servicio_ETC_ConsultaDeTransacciones_OutputMessage">
    <wsdl:part name="parameters" element="tns:ConsultaDeTransaccionesResponse" />
    </wsdl:message>
    - <wsdl:message name="IAgente_Servicio_ETC_ListaDeTags_InputMessage">
    <wsdl:part name="parameters" element="tns:ListaDeTags" />
    </wsdl:message>
    - <wsdl:message name="IAgente_Servicio_ETC_ListaDeTags_OutputMessage">
    <wsdl:part name="parameters" element="tns:ListaDeTagsResponse" />
    </wsdl:message>
    - <wsdl:message name="IAgente_Servicio_ETC_ResultadoListasDeTags_InputMessage">
    <wsdl:part name="parameters" element="tns:ResultadoListasDeTags" />
    </wsdl:message>
    - <wsdl:message name="IAgente_Servicio_ETC_ResultadoListasDeTags_OutputMessage">
    <wsdl:part name="parameters" element="tns:ResultadoListasDeTagsResponse" />
    </wsdl:message>
    - <wsdl:message name="IAgente_Servicio_ETC_TagsPorNumeroDocumento_InputMessage">
    <wsdl:part name="parameters" element="tns:TagsPorNumeroDocumento" />
    </wsdl:message>
    - <wsdl:message name="IAgente_Servicio_ETC_TagsPorNumeroDocumento_OutputMessage">
    <wsdl:part name="parameters" element="tns:TagsPorNumeroDocumentoResponse" />
    </wsdl:message>
    - <wsdl:message name="IAgente_Servicio_ETC_Echo_InputMessage">
    <wsdl:part name="parameters" element="tns:Echo" />
    </wsdl:message>
    - <wsdl:message name="IAgente_Servicio_ETC_Echo_OutputMessage">
    <wsdl:part name="parameters" element="tns:EchoResponse" />
    </wsdl:message>
    - <wsdl:message name="IAgente_Servicio_ETC_ws_add_InputMessage">
    <wsdl:part name="parameters" element="tns:ws_add" />
    </wsdl:message>
    - <wsdl:message name="IAgente_Servicio_ETC_ws_add_OutputMessage">
    <wsdl:part name="parameters" element="tns:ws_addResponse" />
    </wsdl:message>
    - <wsdl:portType name="IAgente_Servicio_ETC">
    - <wsdl:operation name="ConsultaDeTransacciones">
    <wsdl:input wsaw:Action="http://tempuri.org/IAgente_Servicio_ETC/ConsultaDeTransacciones" message="tns:IAgente_Servicio_ETC_ConsultaDeTransacciones_InputMessage" />
    <wsdl:output wsaw:Action="http://tempuri.org/IAgente_Servicio_ETC/ConsultaDeTransaccionesResponse" message="tns:IAgente_Servicio_ETC_ConsultaDeTransacciones_OutputMessage" />
    </wsdl:operation>
    - <wsdl:operation name="ListaDeTags">
    <wsdl:input wsaw:Action="http://tempuri.org/IAgente_Servicio_ETC/ListaDeTags" message="tns:IAgente_Servicio_ETC_ListaDeTags_InputMessage" />
    <wsdl:output wsaw:Action="http://tempuri.org/IAgente_Servicio_ETC/ListaDeTagsResponse" message="tns:IAgente_Servicio_ETC_ListaDeTags_OutputMessage" />
    </wsdl:operation>
    - <wsdl:operation name="ResultadoListasDeTags">
    <wsdl:input wsaw:Action="http://tempuri.org/IAgente_Servicio_ETC/ResultadoListasDeTags" message="tns:IAgente_Servicio_ETC_ResultadoListasDeTags_InputMessage" />
    <wsdl:output wsaw:Action="http://tempuri.org/IAgente_Servicio_ETC/ResultadoListasDeTagsResponse" message="tns:IAgente_Servicio_ETC_ResultadoListasDeTags_OutputMessage" />
    </wsdl:operation>
    - <wsdl:operation name="TagsPorNumeroDocumento">
    <wsdl:input wsaw:Action="http://tempuri.org/IAgente_Servicio_ETC/TagsPorNumeroDocumento" message="tns:IAgente_Servicio_ETC_TagsPorNumeroDocumento_InputMessage" />
    <wsdl:output wsaw:Action="http://tempuri.org/IAgente_Servicio_ETC/TagsPorNumeroDocumentoResponse" message="tns:IAgente_Servicio_ETC_TagsPorNumeroDocumento_OutputMessage" />
    </wsdl:operation>
    - <wsdl:operation name="Echo">
    <wsdl:input wsaw:Action="http://tempuri.org/IAgente_Servicio_ETC/Echo" message="tns:IAgente_Servicio_ETC_Echo_InputMessage" />
    <wsdl:output wsaw:Action="http://tempuri.org/IAgente_Servicio_ETC/EchoResponse" message="tns:IAgente_Servicio_ETC_Echo_OutputMessage" />
    </wsdl:operation>
    - <wsdl:operation name="ws_add">
    <wsdl:input wsaw:Action="http://tempuri.org/IAgente_Servicio_ETC/ws_add" message="tns:IAgente_Servicio_ETC_ws_add_InputMessage" />
    <wsdl:output wsaw:Action="http://tempuri.org/IAgente_Servicio_ETC/ws_addResponse" message="tns:IAgente_Servicio_ETC_ws_add_OutputMessage" />
    </wsdl:operation>
    </wsdl:portType>
    - <wsdl:binding name="BasicHttpBinding_IAgente_Servicio_ETC" type="tns:IAgente_Servicio_ETC">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
    - <wsdl:operation name="ConsultaDeTransacciones">
    <soap:operation soapAction="http://tempuri.org/IAgente_Servicio_ETC/ConsultaDeTransacciones" style="document" />
    - <wsdl:input>
    <soap:body use="literal" />
    </wsdl:input>
    - <wsdl:output>
    <soap:body use="literal" />
    </wsdl:output>
    </wsdl:operation>
    - <wsdl:operation name="ListaDeTags">
    <soap:operation soapAction="http://tempuri.org/IAgente_Servicio_ETC/ListaDeTags" style="document" />
    - <wsdl:input>
    <soap:body use="literal" />
    </wsdl:input>
    - <wsdl:output>
    <soap:body use="literal" />
    </wsdl:output>
    </wsdl:operation>
    - <wsdl:operation name="ResultadoListasDeTags">
    <soap:operation soapAction="http://tempuri.org/IAgente_Servicio_ETC/ResultadoListasDeTags" style="document" />
    - <wsdl:input>
    <soap:body use="literal" />
    </wsdl:input>
    - <wsdl:output>
    <soap:body use="literal" />
    </wsdl:output>
    </wsdl:operation>
    - <wsdl:operation name="TagsPorNumeroDocumento">
    <soap:operation soapAction="http://tempuri.org/IAgente_Servicio_ETC/TagsPorNumeroDocumento" style="document" />
    - <wsdl:input>
    <soap:body use="literal" />
    </wsdl:input>
    - <wsdl:output>
    <soap:body use="literal" />
    </wsdl:output>
    </wsdl:operation>
    - <wsdl:operation name="Echo">
    <soap:operation soapAction="http://tempuri.org/IAgente_Servicio_ETC/Echo" style="document" />
    - <wsdl:input>
    <soap:body use="literal" />
    </wsdl:input>
    - <wsdl:output>
    <soap:body use="literal" />
    </wsdl:output>
    </wsdl:operation>
    - <wsdl:operation name="ws_add">
    <soap:operation soapAction="http://tempuri.org/IAgente_Servicio_ETC/ws_add" style="document" />
    - <wsdl:input>
    <soap:body use="literal" />
    </wsdl:input>
    - <wsdl:output>
    <soap:body use="literal" />
    </wsdl:output>
    </wsdl:operation>
    </wsdl:binding>
    - <wsdl:service name="Agente_Servicio_ETC">
    - <wsdl:port name="BasicHttpBinding_IAgente_Servicio_ETC" binding="tns:BasicHttpBinding_IAgente_Servicio_ETC">
    <soap:address location="http://win-r6ddgayo3y4/PeajeElect/Bcac.PeajeElect.Agente_Servicio_ETC.svc" />
    </wsdl:port>
    </wsdl:service>
    </wsdl:definitions>

    user5514643 wrote:
    Can you give some tip about how connect the web service ?The HTTP protocol obviously need to be used. Oracle provides a couple of HTTP client (web browser like) interfaces. Obviously there is no rendering engine/DOM in PL/SQL as this does not make much sense in a server side language. As a web service typically returns XML, that is not a problem as XML is something that servers need to deal with - and Oracle fully supports XML via SQL, PL/SQL and database structures.
    A basic example of how to use the UTL_HTTP interface for interacting with a web service is in {message:id=4205205}. If you scroll up in that thread, you will also see more complex approaches of loading the web service WSDL and using that to make calls to the service - something that involves too many moving parts and Java unnecessarily.

  • Basic authentication when calling a web service

    I am attempting to call a web service using ActionScript. The
    web service provider requires that I use HTTP Basic Authentication
    to communicate my SOAP requests. I cannot seem to get this done in
    ActionScript. If I instantiate a WebService object and call its
    SetCredentials method, I get an error "Authentication not supported
    on DirectHTTPChannel (no proxy)". I have the WebService object's
    useProxy property set to true. HELP!

    I know this is five years later on this forum but there's no solution here or on any other forum.  So after two day's of hammering this out I was able to produce a workable solution.  Create a new user account for testing.
    Wu_Xiao's explanation of the issue was dead on.  The WebService does a GET then a POST and for the GET we are unable to supply the Authorization in the header and this is why we get the popup. The POST has the Authorization but it already to late. 
    Take these actions
    1 Create a new user on the machine with the web services. Start with a simple name and password (text only)  I had issues with different users. Start clean and simple.
    2 Copy your web services a second usable service.  You'll see in my example below i have Ive copied  ServicesSECURE/Services1.asmx?WSDL to ServicesDEFINITION/Services1.asmx?WSDL
    3 Remove all of the code inside of your services making the new set of service like a definition service. Make sure all of the inputs and outputs are the same. ServicesDEFINITION will have no coding and empty returns.
    Example  
    [WebMethod]
            public String CountUsers(string group)
                return "";
    4 Implement the code below. Call the init() right away to instantiate the web service and wait until it loads to use any of the services.  I use a button event to test.
    private var testws:WebService = new WebService;
      private function init():void
      testws.wsdl="http://test.com/ServicesDEFINITION/Services1.asmx?WSDL";
      var encoder:Base64Encoder= new Base64Encoder();
      encoder.insertNewLines = false; // see below for why you need to do this
      encoder.encode("USERNAME:PASSWORD");
      testws.httpHeaders = {Authorization:" Basic " + encoder.toString()};
      testws.loadWSDL();
      testws.addEventListener("load", wsdlLoadHandler);
      protected function test_clickHandler(event:MouseEvent):void
      testws["CountUsers"].addEventListener(mx.rpc.events.FaultEvent.FAULT,testFaultHandler);
      testws["CountUsers"].addEventListener(mx.rpc.events.ResultEvent.RESULT,testResultHandler) ;
      testws.endpointURI="http://test.com/ServicesSECURE/Services1.asmx?WSDL";
      testws.getOperation("CountUsers").send("Test");
      protected function wsdlLoadHandler (event:LoadEvent) : void
      //the service has to load before using the getOperation function
      //you could try using mx.core.UIComponent.callLater from
      //this listener and call the gettestws.getOperation("Co....
    So you'll see that the ServicesDEFINITION (GET) is called and grabs the definition of the Service1 service but this unsecured services is useless because we've removed all of the code.  After the definition GET is called we can change the end point using endpointURI and perform the POST against our secure ServicesSECURE.

  • How to access HttpRequest Object from Axis web service?

    Hi all,
    I have Axis web service named shoppingcartService,
    and i have ShoppingCartImpl as implemention class which
    implements passfamily() method
    When client access my web service, ShoppingCartImpl's passFamily method is executed.
    I have one more servlet under my axis web application which implements business logic.
    problem is that i want to call/invoke this servlet from passfamily method of ShopingCartImpl class.
    So how can i call/invoke servlet from passFamily method of ShoppingCartImpl class ?
    (All stuff is under Axis web application under Tomcat).

    hi
    the following link may helpful to you
    http://e-docs.bea.com/wls/docs81/webserv/anttasks.html#1111537
    Regards
    Prasanna Yalam

  • How to call COPY web service from sharepoint in SAP

    Hello Experts,
    I want to call COPY web service from SharePoint in SAP  web dynpro / JAVA application.
    However, when I try to connect to web service and download wsdl using   http:// <hostname:port>/_vti_bin/copy.asmx?wsdl
    it results in Unauthorized error and doesnt complete the setup. Detail error is :
     Error occurred while downloading WSIL file. Error message: Deserializing xml stream  http:// <hostname:port>/_vti_bin/copy.asmx?wsdl
    failed.com.sap.engine.services.webservices.espbase.wsdl.exceptions.WSDLException: Invalid Response Code: (401) Unauthorized. The requested URL was:"Connect to 
    http:// <hostname:port>/_vti_bin/copy.asmx?wsdl , used user to connect: userid"
    I am trying to connect with server user account. Any idea on what authorizations might be required or any help on the scenario .
    -Abhijeet

    Here's an example on how to delete a list item, hopefully this helps
    package com.jw.sharepoint.examples;
    import java.io.File;
    import java.text.SimpleDateFormat;
    import java.util.Calendar;
    import java.util.Date;
    import java.util.Properties;
    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;
    import org.w3c.dom.Element;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    import com.microsoft.sharepoint.webservices.CopySoap;
    import com.microsoft.sharepoint.webservices.GetListItems;
    import com.microsoft.sharepoint.webservices.GetListItemsResponse;
    import com.microsoft.sharepoint.webservices.ListsSoap;
    import com.microsoft.sharepoint.webservices.UpdateListItems.Updates;
    import com.microsoft.sharepoint.webservices.UpdateListItemsResponse.UpdateListItemsResult;
    public class SharePointDeleteListItemExample extends SharePointBaseExample {
     private String delete = null;
     private String deleteListItemQuery = null;
     private String queryOptions = null;
     private static final Log logger = LogFactory.getLog(SharePointUploadDocumentExample.class);
     private static Properties properties = new Properties();
     public Properties getProperties() {
      return properties;
      * @param args
     public static void main(String[] args) {
      logger.debug("main...");
      SharePointDeleteListItemExample example = new SharePointDeleteListItemExample();
      try {
       example.initialize();
       CopySoap cp = example.getCopySoap();
       example.uploadDocument(cp, properties.getProperty("copy.sourceFile"));
       ListsSoap ls = example.getListsSoap();
       example.executeQueryAndDelete(ls);
      } catch (Exception ex) {
       logger.error("Error caught in main: ", ex);
     public void executeQueryAndDelete(ListsSoap ls) throws Exception {
      Date today = Calendar.getInstance().getTime();
      SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
      String formattedDate = simpleDateFormat.format(today);
      String queryFormatted = String.format(deleteListItemQuery,formattedDate);  
      GetListItems.QueryOptions msQueryOptions = new GetListItems.QueryOptions();
      GetListItems.Query msQuery = new GetListItems.Query();
      msQuery.getContent().add(createSharePointCAMLNode(queryFormatted));
      msQueryOptions.getContent().add(createSharePointCAMLNode(this.queryOptions));
      GetListItemsResponse.GetListItemsResult result = ls.getListItems(
        properties.getProperty("folder"), "", msQuery, null, "",
        msQueryOptions, "");
      writeResult(result.getContent().get(0), System.out);
      Element element = (Element) result.getContent().get(0);
      NodeList nl = element.getElementsByTagName("z:row");
      for (int i = 0; i < nl.getLength(); i++) {
       Node node = nl.item(i);
       String id = node.getAttributes().getNamedItem("ows_ID").getNodeValue();
       String fileRefRelativePath = node.getAttributes().getNamedItem("ows_FileRef").getNodeValue();
       logger.debug("id: " + id);
       logger.debug("fileRefRelativePath: " + fileRefRelativePath);
       String fileRef = properties.getProperty("delete.FileRef.base") + fileRefRelativePath.split("#")[1];
       logger.debug("fileRef: " + fileRef);
       deleteListItem(ls, properties.getProperty("folder"), id, fileRef);
     public void deleteListItem(ListsSoap ls, String listName, String listId, String fileRef) throws Exception {
      String deleteFormatted = String.format(delete, listId, fileRef);  
      Updates u = new Updates();
      u.getContent().add(createSharePointCAMLNode(deleteFormatted));
      UpdateListItemsResult ret = ls.updateListItems(listName, u);
      writeResult(ret.getContent().get(0), System.out);
     public void initialize() throws Exception {
      logger.info("initialize()...");
      properties.load(getClass().getResourceAsStream("/SharePointDeleteListItemExample.properties"));
      super.initialize();
      this.delete = new String(readAll(new File(this.getClass().getResource("/Delete.xml").toURI())));
      this.deleteListItemQuery = new String(readAll(new File(this.getClass().getResource("/DeleteListItemQuery.xml").toURI())));
      this.queryOptions = new String(readAll(new File(this.getClass().getResource("/QueryOptions.xml").toURI())));
    Brandon James SharePoint Developer/Administrator

  • How to call a web service that is managed by web services manager from omni

    Ok gurus... here is an interesting one for you.
    We have a set of web services that are deployed to our server. We have Oracle Web Services Manager deployed to another server and is acting as a gateway to our web services.
    We would like to call our web service and pass it the username and password that were specified in the omniportlet connection information screen. How do we go about doing this?
    PS. We are using the latest version of portal (10.1.4).
    Thanks for your help.
    Cheers,
    Cory

    Just a follow up. What I would like to do is to have omni portlet add standard header information for security such as the following:
    <soap:Header>
    <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/200401-wss-wssecurity-secext-1.0.xsd">
    <wsse:UsernameToken xmlns:wsse="http://docs.oasis-open.org/wss/200401-wss-wssecurity-secext-1.0.xsd">
    <wsse:Username>theusername</wsse:Username>
    <wsse:Password>thepassword</wsse:Password>
    </wsse:UsernameToken>
    </wsse:Security>
    </soap:Header>
    Any ideas on how to get omniportlet do this? Any ideas on where to look for the answer? Oracle dudes: Any plans to add this to future releases?
    Thanks again folks :-)
    Cory

  • Urgent - How to call a Web Services from PLSQL - Please help

    Hello,
    I am very much new to WebServices, need to call web services through PLSQL. I have a urgent requirement, where i need to call the web services by passing from some paramters to it and the web services will return a varchar values as 'PASSED' or 'FAILED'.
    Can you please approch me the best way to start with.
    Thanks,
    Srikanth.

    Hi,
    I need to do it from PLSQL API's not from JAVA.
    I have started developing the code through UTIL_HTTP. Getting lots of error.
    Can you please guide me through these error.
    Below is the wsdl and a blcok where i am trying to retrive the value from webservice.
    Hope this will help you.
    Code:
    declare
    soap_request varchar2(30000);
    soap_respond varchar2(30000);
    http_req utl_http.req;
    http_resp utl_http.resp;
    resp XMLType;
    i integer;
    begin
    soap_request:= '<?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/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <SOAP-ENV:Body>
    <ns1:soapCheckRequest1 wsdl:ns1="https://isportal-qa.iss.net/exportcompliancemanager/services/ExportCheckService" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <FirstName xsi:type="xsd:string">saddam</FirstName>
    <LastName xsi:type="xsd:string">hussein</LastName>
              <companyName xsi:type="xsd:string">samueladams</companyName>
              <address1 xsi:type="xsd:string">123 APT</address1>
              <address3 xsi:type="xsd:string">Atlanta</address3>
              <city xsi:type="xsd:string">uk</city>
              <stateOrRegion xsi:type="xsd:string">GA</stateOrRegion>
              <postalCode xsi:type="xsd:string">30338</postalCode>
              <email xsi:type="xsd:string">sj@samueladams</email>
              <isoCountryCode xsi:type="xsd:string">US</isoCountryCode>
              <endUserIP xsi:type="xsd:string">209.134.168.203</endUserIP>
    </ns1:soapCheckRequest1>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    http_req:= utl_http.begin_request
    ( 'http://isportal-qa.iss.net/exportcompliancemanager/services/ExportCheckService'
    , 'POST'
    , 'HTTP/1.1'
    utl_http.set_header(http_req, 'Content-Type', 'text/xml'); -- since we are dealing with plain text in XML documents
    utl_http.set_header(http_req, 'Content-Length', length(soap_request));
    utl_http.set_header(http_req, 'SOAPAction', ''); -- required to specify this is a SOAP communication
    utl_http.write_text(http_req, soap_request);
    http_resp:= utl_http.get_response(http_req);
    DBMS_OUTPUT.PUT_LINE('-------utl_http.get_response---------------------');
    DBMS_OUTPUT.PUT_LINE('http_resp.status_code is :'||http_resp.status_code );
    DBMS_OUTPUT.PUT_LINE('http_resp.reason_phrase is :'||http_resp.reason_phrase);
    DBMS_OUTPUT.PUT_LINE('http_resp.http_version is :'||http_resp.http_version);
    DBMS_OUTPUT.PUT_LINE('http_resp.private_hndl is :'||http_resp.private_hndl);
    DBMS_OUTPUT.PUT_LINE('-------utl_http.get_response----------------------');
    utl_http.read_text(http_resp, soap_respond);
    utl_http.end_response(http_resp);
    resp:= XMLType.createXML(soap_respond);
    resp:= resp.extract('/soap:Envelop/soap:Body/child::node()'
    , 'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"'
    i:=0;
    loop
    dbms_output.put_line(substr(soap_respond,1+ i*255,250));
    i:= i+1;
    if i*250> length(soap_respond)
    then
    exit;
    end if;
    end loop;
    end;
    Error Message
    http_resp.reason_phrase is :Internal Server Error
    http_resp.http_version is :HTTP/1.1
    http_resp.private_hndl is :0
    -------utl_http.get_response----------------------
    <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><soapenv:Fault><faultco
    apenv:Server.userException</faultcode><faultstring>org.xml.sax.SAXParseException: The prefix &quot;ns1&quot; for element &quot;ns1:soapCheckRequest1&quot; is not bound.</faultstring><detail><ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">atlcms
    2.iss.net</ns1:hostname></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>
    <?xml version="1.0" encoding="UTF-8" ?>
    - <wsdl:definitions targetNamespace="https://isportal-qa.iss.net/exportcompliancemanager/services/ExportCheckService" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="https://isportal-qa.iss.net/exportcompliancemanager/services/ExportCheckService" xmlns:intf="https://isportal-qa.iss.net/exportcompliancemanager/services/ExportCheckService" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    - <!--
    WSDL created by Apache Axis version: 1.3
    Built on Oct 05, 2005 (05:23:37 EDT)
    -->
    - <wsdl:message name="soapCheckResponse1">
    <wsdl:part name="soapCheckReturn" type="soapenc:string" />
    </wsdl:message>
    - <wsdl:message name="soapCheckRequest1">
    <wsdl:part name="firstName" type="soapenc:string" />
    <wsdl:part name="lastName" type="soapenc:string" />
    <wsdl:part name="companyName" type="soapenc:string" />
    <wsdl:part name="address1" type="soapenc:string" />
    <wsdl:part name="address2" type="soapenc:string" />
    <wsdl:part name="address3" type="soapenc:string" />
    <wsdl:part name="city" type="soapenc:string" />
    <wsdl:part name="stateOrRegion" type="soapenc:string" />
    <wsdl:part name="postalCode" type="soapenc:string" />
    <wsdl:part name="email" type="soapenc:string" />
    <wsdl:part name="phone" type="soapenc:string" />
    <wsdl:part name="isoCountryCode" type="soapenc:string" />
    <wsdl:part name="endUserId" type="soapenc:string" />
    <wsdl:part name="endUserIP" type="soapenc:string" />
    <wsdl:part name="endUserSession" type="soapenc:string" />
    <wsdl:part name="performGovCheck" type="xsd:boolean" />
    <wsdl:part name="sendEmailNotification" type="xsd:boolean" />
    <wsdl:part name="screeningLevelBasedOnSuppliedCountryCode" type="xsd:boolean" />
    <wsdl:part name="screeningLevelBasedOnEndUserIP" type="xsd:boolean" />
    <wsdl:part name="soundexMatch" type="xsd:boolean" />
    </wsdl:message>
    - <wsdl:message name="soapCheckRequest">
    <wsdl:part name="firstName" type="soapenc:string" />
    <wsdl:part name="lastName" type="soapenc:string" />
    <wsdl:part name="companyName" type="soapenc:string" />
    <wsdl:part name="address1" type="soapenc:string" />
    <wsdl:part name="address2" type="soapenc:string" />
    <wsdl:part name="address3" type="soapenc:string" />
    <wsdl:part name="city" type="soapenc:string" />
    <wsdl:part name="stateOrRegion" type="soapenc:string" />
    <wsdl:part name="postalCode" type="soapenc:string" />
    <wsdl:part name="email" type="soapenc:string" />
    <wsdl:part name="phone" type="soapenc:string" />
    <wsdl:part name="isoCountryCode" type="soapenc:string" />
    <wsdl:part name="endUserId" type="soapenc:string" />
    <wsdl:part name="endUserIP" type="soapenc:string" />
    <wsdl:part name="endUserSession" type="soapenc:string" />
    <wsdl:part name="performGovCheck" type="xsd:boolean" />
    <wsdl:part name="sendEmailNotification" type="xsd:boolean" />
    <wsdl:part name="screeningLevelBasedOnEndUserIP" type="xsd:boolean" />
    <wsdl:part name="soundexMatch" type="xsd:boolean" />
    </wsdl:message>
    - <wsdl:message name="soapCheckResponse">
    Thanks and Regard,
    Srikanth

  • How can I call a web service using JAVAscript in LCD

    hi guys,
         I know it can call a WSDL in LCD, but I have not any WSDL web service , and I have a REST web service ,how can I call this REST web service in LCD? I checked some documents and found nothing...if it's possible that it can call a REST web service using JAVAScript code, I mean I can program some code to call this web service ?
    thanks,
    Jesse

    Hi Jesse,
    You can do GET, PUT and POST using FormCalc, so you should be able to access a REST web service. 
    There is a example of accessing a RSS feed in this thread, http://forums.adobe.com/message/5695433#5695433
    Regards
    Bruce

  • How to call a web Service from Oracle Applications?

    Hi friends,
    I've posted this question on OA Framework forum , but may be it's more appropiated put it here. Sorry for do it again:
    It's about how to call a web service from a Form or a .sql (via Request) in Oracle Applications:
    Could you please explain here the detailed steps (with code example if it's possible) to invoke a webservice from Oracle Applications?.. how did yo do it...?
    I've read differents posts here and the 33097.1 metalink note (by the way, the first recommended link in this note is broken...), but there are lots of theorical concepts and no real examples to see how/from where invoke the WS
    I'll have to call one webservice (I suppose the customer will give me the interface implementation)...but I've never did it with Applications so that's why I ask you for all the detailed steps...
    I work with Forms 6i, Apps 11.5.10.2 and DB 9.2.0.7.
    Thanks a lot.
    Jose.

    Hello Jose,
    I did using java program to call BPEL web services in 11.5.10.
    I pasted below the metalink note for your reference (Note:250964.1)
    The idea is first write a java program to call the webservice (in my case it is calling an BPEL web service, so this may not help directly), test it.
    Then port the java program as specified in the note, so that you could call your web service through concurrent manager scheduler.
    Is this ok?
    Thanks
    Arun.
    ======================================================
    Checked for relevance on 25-Apr-2007
    Application Install - Version: 11.5.8 to 11.5.10
    Goal
    ====
    How to register and create a Java concurrent program for Oracle Applications
    Release 11i
    Solution
    ========
    1. Create your Java Concurrent Program (JCP) , using a text editor.
    /*===========================================================================+
    | Concurrent Processing Sample Code |
    | |
    | FILENAME |
    | Hello.java |
    | |
    | DESCRIPTION |
    | Sample Java concurrent program |
    | About the simplest possible program, just writes a message to the |
    | logfile and output file. |
    | |
    | HISTORY |
    | $Log$ |
    | |
    +===========================================================================*/
    package oracle.apps.fnd.cp.sample;
    import oracle.apps.fnd.cp.request.*;
    public class Hello implements JavaConcurrentProgram {
    public static final String RCS_ID = "$Header$";
    public void runProgram(CpContext ctx) {
    ctx.getLogFile().writeln("-- Hello World! --", 0);
    ctx.getOutFile().writeln("-- Hello World! --");
    ctx.getReqCompletion().setCompletion(ReqCompletion.NORMAL, "");
    =======================================
    End Sample
    =======================================
    2. Create a sample directory under $JAVA_TOP:
    $ mkdir $JAVA_TOPoracle/apps/fnd/cp/sample
    3. Copy Hello.java into $JAVA_TOP/oracle/apps/fnd/cp/sample:
    $ cp $HOME/Hello.java $JAVA_TOP/oracle/apps/fnd/cp/sample
    4. Compile your java program:
    javac $JAVA_TOP/oracle/apps/fnd/cp/sample/Hello.java
    5. Test at the command line with following syntax:
    jre -Ddbcfile=$FND_TOP/secure/your_dbc_file.dbc \
    -Drequest.outfile=./outfile \
    oracle.apps.fnd.cp.request.Run \
    oracle.apps.fnd.cp.sample.Hello
    6. Register your custom java concurrent program with Oracle Applications.
    a. Navigate: Concurrent > Program > Executable
    b. Enter details into the form
    Executable: JCPHELLO
    Shortname: JCPHELLO
    Application: Application Object Library
    Execution Method: Java Concurrent Program
    Execution File Name: Hello (Insert a name that does not contain space or period)
    Execution File Path: oracle.apps.fnd.cp.sample
    c. Save the details
    d. Navigate: Concurrent > Program > Define
    e. Enter details into the form
    Program Name: JCPHELLO
    Program Shortname: JCPHELLO
    Application: Application Object Library
    Executable: Choose JCPHELLO from LOV
    Executable Options :
    f. Save the details
    7. Add this new concurrent request to your responsibility request group.
    a. Navigate > Security > Responsiblity > Request
    b. Query System Administrator
    c. Add new row and choose TestJava
    d. Save the changes.
    8. Run your new Hello Java Concurrent Program
    Navigate: Request > Run
    References
    ~~~~~~~~~~~
    Oracle Applications Developers Manual for Release 11i A75545-01
    ====================================================

  • HOW TO CALL A WEB SERVICE OR EJB FROM BPEL

    HI
    i want to call java web service or ejb from my bpel process. how can i do this.
    i am using oracle soa10.1.3.1.0 and jdeveloper 10.1.3.1.0 and oracle database xe 10g.
    thanks in advance K ROY

    You could deploy your EJB or Java under a web service into your OC4J, after that, you invoke a partnerlink from BPEL to the destination of wsdl will do. Also don't forget to add in your XSD schema as well.
    Thanks,
    Jyno

Maybe you are looking for

  • How to find user group from tcode

    Hi Experts, I have custom tcode from this i found report name as AQIDSYSTQV000001SD_RR_03====== I am unable to find Queryname in SQ01 from this. When i saw some of the forums i  understood that IDSYST is the user group for my query but i am unable to

  • I am trying to install an new hard drive into my 15-inch, late 2008 MacBook Pro

    I put a new 750Gb Seagate drive in and booted with the Snow Leopard install disk. I held the "C" key down and the disk began to load. An icon of a folder with a question mark flashed. The install process stalled there and I could do no more. I checke

  • NoSuchMethodError in XSL Transformation

    I am trying to run this piece of code to transform an xml file to html. DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document docData = builder.parse("orders.xml"); DOM

  • Scanning using Airport and an HP printer

    If I use a HP printer with Airport Extreme and a Windows Vista computer, will I still be able to scan? Message was edited by: Jrmie

  • Date format in PDF "Printer friendly"

    I am using obiee 10.1.3.4.1 Is it possible to change date format in PDF files that are exported with "Printer friendly" option? For example I have prompt with date 01.12.2011. I want to export whole dashboard (prompt with report) to PDF with "Printer