NoClassdefFound Problem using EJB as web service client

Hello there, I am trying to use a MDB as a web service client. The architecture,
briefly is in the form of a java program communicating with a MDB via JMS, the
MDB gets the data from some external server via SOAP. I am using JBuilder to generate
the client side classes choosing the Axis framework. When my MDB is trying to
bind using locator.getPort() it throws an error as follows:
java.lang.NoClassDefFoundError: org.apache.axis.client.AxisClient. java.lang.NoClassDefFoundError:
org.apache.axis.client.AxisClient at org.apache.axis.client.Service.getAxisClient()Lorg.apache.axis.client
AxisClient;(Service.java:143) at org.apache.axis.client.Service.<init>()V(Service.java:152)
Note that it works fine if I use the web services client as a standalone java
program(no weblogic ). I tried putting the Axis.jar file as well as the relevant
files from this jar file(JBuilder's feature) in the EJB module that is deployed,
of no avail. Following is the classloader printed from the EJB's onMessage method
if needed for better understanding
weblogic.utils.classloaders.GenericClassLoader@afdd3a finder: weblogic.utils.cla
ssloaders.MultiClassFinder@20d7479 annotation: SecurityEJBModule@
Any help will be appreciated

Slava, I did exactly that and it worked! I wish I had seen your reply before.
Thanks
"Slava Imeshev" <[email protected]> wrote:
>
"Santosh" <[email protected]> wrote in message news:405074c7$[email protected]..
Hello there, I am trying to use a MDB as a web service client. Thearchitecture,
briefly is in the form of a java program communicating with a MDB viaJMS, the
MDB gets the data from some external server via SOAP. I am using JBuilderto generate
the client side classes choosing the Axis framework. When my MDB istrying to
bind using locator.getPort() it throws an error as follows:
java.lang.NoClassDefFoundError: org.apache.axis.client.AxisClient.java.lang.NoClassDefFoundError:
org.apache.axis.client.AxisClient at org.apache.axis.client.Service.getAxisClient()Lorg.apache.axis.client
AxisClient;(Service.java:143) at org.apache.axis.client.Service.<init>()V(Service.java:152)
Note that it works fine if I use the web services client as a standalonejava
program(no weblogic ). I tried putting the Axis.jar file as well asthe relevant
files from this jar file(JBuilder's feature) in the EJB module thatis deployed,
of no avail. Following is the classloader printed from the EJB's onMessagemethod
if needed for better understandingYou need to package all Axis jars and dependancoes into the EAR and
refer tham
in your ejb-jar MANIFEST.MF. If you are running weblogic 8.1, you may
just put them
into APP-INF/lib. Than you won't need to modify manifest.
Hope this helps.
Regards,
Slava Imeshev

Similar Messages

  • Problems - WLS 10.0 web service client

    I'm having a few issues with WLS 10.0 web service client.
              I generated a service control from the WSDL. The service is provided by a 3rd party (non-WLS) at another company. I generated the control within my web project and it's deployed as part of the web application. I experience the following problems with the service control API:
              1) The methods setKeyStore(), setTrustStore(), setClientCert() all seem to be ignored - the server always uses the values set in the server's environment definition. Note - the setEndpointAddress() seems to work.
              2) The client request does not set the 'Content-Type' HTTP header correctly (it's set to text/html) - I have no way to override this via the service control API (that I can see).
              3) I don't see any way/place to turn on more detailed tracing of what's going on internally with the service control invocation - is there a way to enable a detailed trace log of what is happening within the service control?
              Note: I'm able to call the web service via the test client (after importing the 3rd party server cert into my local cacerts).
              Thanks,
              [email protected]

    Thank you for the reply..
    But im still geting the same error. I have tried to include all the libraries in JWSDP pack but still.. I have managed to narrow down the place where the error occures.. It actually happens when I try to get the WebService Client Servant which is located in the package LSC:
    ---> LSC.LWServiceGenClient.LWS_Impl service = new LSC.LWServiceGenClient.LWS_Impl();
    LSC.LWServiceGenClient.LWSServantInterface lagerServiceServant = LSC.LWServiceGenClient.LWSServantInterface_Stub)service.getLWSServantInterfacePort();
    return lagerServiceServant;
    Could something be wrong with the way I package the Jar? I'm using Sun One Studio and have tried including the 5 packages the application consists of; I have tried including just the files; moving the main class to <root>.. Still same problem..
    Or could there be some different fundemental thingy I have forgotten ??
    thanks
    Aqoi

  • Problems running Application with Web Service Client

    Im having some problems maybe related to some classpath details?
    I am running a Web Service another computer which works fine. I have also made an application using Sun ONE Studio 1 consisting of a Web Service Client etc. and GUI which uses the Client to get data from the Web Service. This works fine as long as I use Sun ONE Studio to execute the application, but now I have packaged the application to a .jar file and have encountered problems:
    When running the application from the .jar file I get the exception:
    java.lang.NoClassDefFoundError: com/sun/xml/rpc/client/BasicService
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
    at util.servicelocator.ServiceLocator.getServant(ServiceLocator.java:68)
    at lagerApp.eHandelLager.jRegisterBrukerListeActionPerformed(eHandelLager.java:784)
    at lagerApp.eHandelLager.access$400(eHandelLager.java:20)
    at lagerApp.eHandelLager$5.actionPerformed(eHandelLager.java:277)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
    at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
    at javax.swing.AbstractButton.doClick(AbstractButton.java:289)
    at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1113)
    at javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(BasicMenuItemUI.java:943)
    at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:231)
    at java.awt.Component.processMouseEvent(Component.java:5100)
    at java.awt.Component.processEvent(Component.java:4897)
    at java.awt.Container.processEvent(Container.java:1569)
    at java.awt.Component.dispatchEventImpl(Component.java:3615)
    at java.awt.Container.dispatchEventImpl(Container.java:1627)
    at java.awt.Component.dispatchEvent(Component.java:3477)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
    at java.awt.Container.dispatchEventImpl(Container.java:1613)
    at java.awt.Window.dispatchEventImpl(Window.java:1606)
    at java.awt.Component.dispatchEvent(Component.java:3477)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
    I have searched the forum and found simular topics which are resolved by adding some lines to the classpath.
    How do I set the classpath? Do i have to use the classpath parameter from command window? How can I know which classpaths to include (libraries)..
    Any help would be nice.. : )

    Thank you for the reply..
    But im still geting the same error. I have tried to include all the libraries in JWSDP pack but still.. I have managed to narrow down the place where the error occures.. It actually happens when I try to get the WebService Client Servant which is located in the package LSC:
    ---> LSC.LWServiceGenClient.LWS_Impl service = new LSC.LWServiceGenClient.LWS_Impl();
    LSC.LWServiceGenClient.LWSServantInterface lagerServiceServant = LSC.LWServiceGenClient.LWSServantInterface_Stub)service.getLWSServantInterfacePort();
    return lagerServiceServant;
    Could something be wrong with the way I package the Jar? I'm using Sun One Studio and have tried including the 5 packages the application consists of; I have tried including just the files; moving the main class to <root>.. Still same problem..
    Or could there be some different fundemental thingy I have forgotten ??
    thanks
    Aqoi

  • Problem using deployed Axis web services

    Dear all,
    I am currently trying to get my first web services up and running on Tomcat 5. I create a simple Java class to return a String:
    public class SayHello2
        public String hello(String in)
            return ("Hello, " + in);
    }From this class I created the WSDL with Java2Wsdl. I created the deployment descriptor using Wsdl2Java and deployed the whole thing using the Axis AdminClient. Finally, I compiled the resulting classes from step 2 and copied them to the directory that corresponds to the package name.
    The web service is listed together with the method in the list provided by Axis. However, I can not access the method, neither entering the direct URL (http://localhost/WSTest/services/SayHello2?in=bla), nor using the stub classes generated by Axis, nor using a org.apache.axis.client.Call. I am quite lost. Does anyone have any ideas what I could check? I've pasted the WSDL below, just in case there's any hint in there. (I can access this wsdl alright with http://localhost/WSTest/services/SayHello2?wsdl).
    Cheers,
    N.
    <?xml version="1.0" encoding="UTF-8"?>
    <wsdl:definitions targetNamespace="urn:testPackage" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="urn:testPackage" xmlns:intf="urn:testPackage" 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.2.1
    Built on Jun 14, 2005 (09:15:57 EDT)-->
       <wsdl:message name="helloResponse">
          <wsdl:part name="helloReturn" type="soapenc:string"/>
       </wsdl:message>
       <wsdl:message name="helloRequest">
          <wsdl:part name="in" type="soapenc:string"/>
       </wsdl:message>
       <wsdl:portType name="SayHello2">
          <wsdl:operation name="hello" parameterOrder="in">
             <wsdl:input message="impl:helloRequest" name="helloRequest"/>
             <wsdl:output message="impl:helloResponse" name="helloResponse"/>
          </wsdl:operation>
       </wsdl:portType>
       <wsdl:binding name="SayHello2SoapBinding" type="impl:SayHello2">
          <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
          <wsdl:operation name="hello">
             <wsdlsoap:operation soapAction=""/>
             <wsdl:input name="helloRequest">
                <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:testPackage" use="encoded"/>
             </wsdl:input>
             <wsdl:output name="helloResponse">
                <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:testPackage" use="encoded"/>
             </wsdl:output>
          </wsdl:operation>
       </wsdl:binding>
       <wsdl:service name="SayHello2Service">
          <wsdl:port binding="impl:SayHello2SoapBinding" name="SayHello2">
             <wsdlsoap:address location="http://localhost/WSTest/services/SayHello2"/>
          </wsdl:port>
       </wsdl:service>
    </wsdl:definitions>

    Thanks for the reply!
    The odd thing is that no exception is thrown at all. All that happens is that I get a null value back when I call the method sayHello (indepent from the way in which I call it, whether using URL access or the client stub). When I deploy the same class as a .jws, called with http://localhost/WSTest/SayHello.jws?method=sayHello&in0=bla, everything works fine. Response:
    <soapenv:Envelope>
      <soapenv:Body>
       <sayHelloResponse    soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <sayHelloReturn xsi:type="xsd:string">Hello, bla</sayHelloReturn>
    </sayHelloResponse>
    </soapenv:Body>
    </soapenv:Envelope>When I call the deployed web servce with http://localhost/WSTest/services/SayHello2?method=sayHello&in0=bla, I get the null value back:
    <soapenv:Envelope>
    <soapenv:Body>
       <sayHelloResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <sayHelloReturn xsi:type="soapenc:string" xsi:nil="true"/>
    </sayHelloResponse>
    </soapenv:Body>
    </soapenv:Envelope>I don't have the slightest clue what the problem could and really need to get this web service thingy going. I have already spent an entire week on this. Any help is greatly appreciated.
    Cheers,
    N.

  • Problem using an SAP Web service??

    Hi I am currently trying to use a Web Dynpro interface to link into an SAP Web Service and search for some data. However this is not working at the moment as I believe there is an issue with my system landscape and i don't know how to resolve it. I get this error:
    Caused by: com.sap.tc.webdynpro.model.webservice.exception.WSModelRuntimeException: Exception on creation of service metadata for web service mass config parameters service reference ID 'ac92ed3a-770d-428f-8b89-3dd26332b858' and application name 'demo.sap.com/poc2'. Check mass configuration has been done properly.
    I already had this issue when I was trying to create a web dynpro interface of a web service that i had created. I did solve that issue however then when i published that project The data was not within the table. I am now trying this as I did not seem to be getting a reply to my previous thread which is here:
    Re: Cannot get Web Dynpro app to work??!
    Ok so now I have started this new project just to see weather it was the web service that was the issue. However when i publish this project i get the error. The things I have tried are below:
    1. Going to the NWA of the server and going to SOA Management --> System Connection and then setting up a new connection with these settings:
    General
    System Type:                                        ABAP
    System Name:                                       HU2
    DB Host:                                                iwdf4158
    Client:                                                    800
    Installation number:                               0120003411
    Connectivity
    Services Source:                                 WSDL
    URL:                                                     http://sr.esworkplace.sap.com:80/ServicesRegistrySiService/ServicesRegistrySiPort
    Username:                                            sruser
    Password:                                           eswork123
    then from this I then tried to apply this connection to my project by going to NWA of the server and going to SOA Management --> Application and Scenario Communication --> Application Communication then I selected my project and added the provider system I had just set up as i presumed with me using a web service from SAP I would have to do this.
    I then tried adding another provider system which was the local server that the instance is installed on.
    Edited by: anixan on Apr 15, 2010 2:31 PM

    Hi Experts,
    I have found that the particular web service that I amusing is running from sr2.esworkplace.sap.com is there any way to find the settings of how to set this up in the Destination Template Manager of my server in order for the app to work. I would appreciate any help that can be offered. Thanks

  • Design Suggestion on webapp using executable windows Web Service client

    We have existing web application that needs to interface with a web service through a client exe file.
    Inputs will be passed by xml file and output files generated after.
    This client exe has configuration file, among the important items on this file is the settings on where the output files will be created.
    I personally think this design is wrong but I will have to work through it because I am in no position to change the proposed solution.
    A synchronized method for the complete cycle of the call to this method will not be acceptable due to bottle neck issue.
    I'm planning to make a singleton class to provide the services for this this client.
    I'm planning to get the client IP to use for making temporary working folder for each user.
    File IO on creation of input file will be surrounded in a synchronized block.
    Runtime.exec call will also be wrapped in a synchronized block.
    I will be executing this single exe on seperate process each call,
    As for the config file, I will have to edit the config file for each call, since i cannot discern the output files if I put them in single location.
    /sigh
    Advise would be greatly appreciated.

    DarrylBurke wrote:
    Seifer wrote:
    Someone please tell me I'm doomed?If you say so.
    You're doomed.
    db
    Note: That's a joke, I don't have any knowledge on the specifics of your question.I thought so. I figured one workaround, maintain multiple copies of the client exe, each with their own config referring to each unique output folder and make a pool manager to manage these babies.
    I still think the better solution is to give away this client and have the webapp interact directly to the web service. The present kind of remind me how cgi process are used in the old times to serve web requests.

  • Sending xsi types using Axis from web service client

    Hello,
    I am using axis to consume a web service, the soap message generated contain xsi types which cause the validation of the message to fail. Example:
    xsi:type="xsd:string"I have tried to remove these types using call.setProperty(Call.SEND_TYPE_ATTR,Boolean.FALSE); but this does not seem to work.
    OPERATION_STYLE=document
    Can someone please help
    Thanks

    Haven't worked on this, but have you tried by putting the axis libraries inside the plugin lib folder when you are building up the plugin? Also you need to check asix2 compatibility with weblogic version with R2.
    -Bikash

  • Web service as another web service client - problem in JavaEE SE?

    Hello,
    I observed strange behaviour with OpenESB, Glassfish (build 33) and following scenario:
    I need to call web service from another web service. When I use simple schema:
    web service client -> web service (as EJB) -> another Web service
    everything works. But I would like to use JBI/ESB, so:
    web service client -> HTTP SOAP BC -> JAVAEE SE -> web service (as EJB) -> another Web service
    the following exception prevents success:
    com.sun.xml.ws.model.RuntimeModelerException: runtime modeler error: Wrapper class cz.muni.fi.yucca.client.jbiws.gamanager.Calculate is not fou
    nd. Have you run APT to generate them?
    at com.sun.xml.ws.model.RuntimeModeler.getClass(RuntimeModeler.java:254)
    at com.sun.xml.ws.model.RuntimeModeler.processDocWrappedMethod(RuntimeModeler.java:550)
    at com.sun.xml.ws.model.RuntimeModeler.processMethod(RuntimeModeler.java:497)
    at com.sun.xml.ws.model.RuntimeModeler.processClass(RuntimeModeler.java:339)
    at com.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:225)
    at com.sun.xml.ws.client.WSServiceDelegate.addSEI(WSServiceDelegate.java:584)
    at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:287)
    at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:270)
    at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:263)
    at javax.xml.ws.Service.getPort(Service.java:92)
    at cz.muni.fi.yucca.client.jbiws.gamanager.GAManagerService.getGAManagerPort(GAManagerService.java:51)
    When I call both services separately they work correctly, when I don't use JBI it works correctly too.
    Should anybody help me solving this problem?
    Thanks in advice, Vlado

    Fine,
    I've found out that this problem is caused by different classloaders assigned to directly (EJBClassloader) and through-JBI (improperly configured URLClassloader) called web services.
    I've moved my question to GlassFish forum (http://forums.java.net/jive/thread.jspa?threadID=24901&tstart=0) beacause of it's "technical" nature.
    Despite this, any help is welcome:-)

  • Deploying Web Service clients to earlier versions of AS

    Hello,
    I'm using JDeveloper to create web service proxy for existing service to use in my Web Service client. For development, I'm using JDeveloper 10.1.3.3, for deployment of client application I'm using Application Server 10.1.3.0.
    The problem is that AS 10.1.3.0 contains other versions of the libraries, for example, wsclient.jar, so, there's an error using Web Service Proxy (stub) as method setSOAPVersion() doesn't exist.
    The question is how can I use generated stub with earlier versions of Application Server.
    I've tried some things, but they didn't work. Maybe I did something wrong and step-by-step guidelines to deploy application are needed - I hope, it could be useful not only for me.
    So, I found JDev 10.1.3 Release Notes (http://www.oracle.com/technology/products/jdev/htdocs/10.1.3.0.3/readme.html) and the following abstract:
    Workaround for URL / WS Data Control Apps When Deploying to Third Party Application Servers or Oracle Application Server 10.1.2 (4931009)
    1. Copy the following JAR files to your target application server along with the rest of the ADF installed JAR files. The following JAR files are available under your JDeveloper's home directory.
    bc4j/jlib/dc-adapters.jar
    bc4j/jlib/adf-connections.jar
    j2ee/home/lib/http_client.jar
    webservices/lib/wsdl.jar
    webservices/lib/orajaxr.jar
    webservices/lib/orawsrm.jar
    webservices/lib/wsclient.jar
    webservices/lib/orasaaj.jar
    webservices/lib/xsdlib.jar
    webservices/lib/mdds.jar
    jlib/osdt_core.jar
    jlib/osdt_cert.jar
    jlib/osdt_xmlsec.jar
    jlib/osdt_wss.jar
    jlib/osdt_saml.jar
    jlib/ojpse.jar
    jlib/oraclepki.jar
    webservices/lib/wssecurity.jar
    webservices/lib/orawsdl.jar
    j2ee/home/jazncore.jar
    2. Shutdown the application server and modify the application server's class path to include all of the JAR files that were extracted from the archive. Please refer to the application server documentation for details on how to modify the class path.
    3. Restart the application server. You are now ready to deploy / run the application successfully.
    So, I've created a new Shared Library with Enterprise Manager, uploaded all this files and, deploying application, checked this library too. This didn't help.
    Thanks in advance, Valeriy

    Hi Valeriy,
    I have exactly the same problem. Have you been able to resolve this yet?
    Thanks
    Stu

  • Web service client ignores http proxy settings

    I have a web service client using Weblogic's web service client library. I'm trying to instruct it to use a http proxy. I've set all the following system properties:
    -Dhttp.proxyHost=127.0.0.1
    -Dhttp.proxyPort=8080 -Dweblogic.webservice.transport.http.proxy.host=127.0.0.1 -Dweblogic.webservice.transport.http.proxy.port=8080
    No traffic is passing through the proxy.
    When the proxy is down, the application works fine too. I suspect that the proxy settings are completely ignored for some reason.
    I'm using Weblogic 8.1 SP4 on a Windows XP box and JDK 1.4.2 (Sun's bundled JDK with Weblogic).

    Sorry about the delay,
    You just need to use the standard java http proxy properties, take a look at:
    http://download-west.oracle.com/docs/cd/A97329_03/web.902/a95453/useservices.htm
    Does this help?
    Gerard

  • Dynamic Logical Port for Web Service Client

    Hi *!
    We want to use the same Web Service Client code with different Web Service instances running on different systems. So I need to configure the logical port (especially the URL of the endpoint) dynamically at runtime.
    Please give me a hint, how this is done.
    (we are using WebAS 6.40 SP7)...
    Thanks in advance,
         Frank

    Hi Frank,
    I hope you were able to solve your issue on you own in the meantime.
    I was looking for the answer to this question today. This was the only thread I found on SDN. Unfortunately, it did not contain an answer yet. I was able to figure out a way to set the endpoint address dynamically after searching help.sap.com and after examining the interfaces offered by the Stub (logical port in this case) classes.
    Here's an extract from my code:
    // Connect to JNDI context
    InitialContext ic = new InitialContext();
    // Get reference to web service proxy from JNDI context
    Z_MSC_GET_SCHEDULE_WSDService service =
         (Z_MSC_GET_SCHEDULE_WSDService) ic.lookup("wsclients/proxies/iot-online.de/msc~srv_ejb~proxy/de.iot_online.msc.proxy.ScheduleReaderProxy");
    // Get reference to logical port from web service proxy
    Z_MSC_GET_SCHEDULE_WSD logicalPort = service.getLogicalPort();
    // Set URL of web service Endpoint
    logicalPort._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, "http://<FQDN>:8010/sap/bc/srt/rfc/sap/Z_MSC_GET_SCHEDULE_WSD?sap-client=100");
    This is explained on
    http://help.sap.com/saphelp_nwce10/helpdata/en/45/113a1221337249e10000000a155369/frameset.htm
    You can also set the credentials (username / password) with the method _setProperty.
    Best regards
    Christian

  • Using SSL for Web Service Access

    Hi,
    I'm not sure if this the best forum, but this is technically a J2EE question.
    I'm using JDeveloper and OC4J. I have a java class that I'm publishing as a stateful webservice; however, the only clients will be other java routines. (I generated a WSDL file and then stubs.) This webservice has to run on a Windows 2000 box inside of OC4J. I have this done and can call it from across the network from a Linux box. This all works fine. However, I need to add security preferably by going to SSL. I can't find out how to do this. Does anyone know? Do I manually edit the generated stub files? Any chance there is some sample code somewhere?
    thanks,
    Joe Gamache

    Please look at Appendix A of the "Web Services Developer's Guide" from iAS v9.0.2 covers Oracle SOAP. The section, "Working With Oracle9 iAS SOAP
    Transport Security", covers using SSL.
    Here is a simple example with steps:
    Prerequisites
    1 . Suppose you have configured Apache to use SSL , that is
    -     Apache has a valid server certificate
    -     Apache requires the client certificate
    -     Apache has a bundle of root certificates of CA with wich it can trust client certificates
    -     Apache is in front of OC4J with mod_oc4j (9.0.2) or mod_proxy ( 1.0.2.2)
    For more information on this please refer to Oracle9i Application Server Security Guide
    2. Have a working knowledge of Oracle Wallet Manager
    Steps
    The following steps let you use an https web services client
    1.     First you need a certificate store in order to store the private key , the client X509 certificate and some trusted authorities. This store in our case is a wallet exported by Oracle Wallet Manager.
    2.     In order to generate a correct wallet you need :
    a.     Start the Oracle Wallet Manager ( OWM )
    b.     Create a new empty wallet
    c.     Generate a Certificate Signing Request (CSR )
    d.     Import the X509 certificate that the CA generated from the CSR
    e.     Import the root certificate of the CA that trusts the server certificate you would like to connect to ( that of Apache )
    f.     Export the wallet
    3.     Let's call exported_wallet the wallet that we exported from OWM , and lets put it under c:\temp . Suppose that the wallet password is camarda.
    4.     The JDK you plan to use for your client , in the extension directory ( that is $JDK_HOME/jre/lib/ext ) , must contains the following library
    a.     jcert.jar
    b.     jsse.jar
    c.     jssl-1_1.jar
    5.     Oracle SSL library use JNI in order to implement some low level encryption API , so you need a shared library usually located in $ORACLE_HOME/bin . For NT platform this library is njssl9.dll . Be sure to have this library in your path
    6.     Now given a WDSL , use the Jdeveloper wizard to generate a proxy
    7.     Modify the URL end-point from http to https
    8.     Add to the proxy the following lines of code
    System.setProperty("ssl.SocketFactory.provider","oracle.security.ssl.OracleSSLSocketFactoryImpl");
    System.setProperty("ssl.ServerSocketFactory.provider","oracle.security.ssl.OracleSSLServerSocketFactoryImpl");
    System.setProperty("java.protocol.handler.pkgs","HTTPClient");
    System.setProperty("oracle.wallet.location","C:\\temp\\exported_wallet");
    System.setProperty("oracle.wallet.password","camarda");
    Example
    In red : modified
    In blue : added
    import oracle.soap.transport.http.OracleSOAPHTTPConnection;
    import java.net.URL;
    import org.apache.soap.Constants;
    import org.apache.soap.Fault;
    import org.apache.soap.SOAPException;
    import org.apache.soap.rpc.Call;
    import org.apache.soap.rpc.Parameter;
    import org.apache.soap.rpc.Response;
    import org.w3c.dom.Element;
    import java.util.Vector;
    import java.util.Properties;
    import oracle.xml.parser.v2.*;
    * Generated by the Oracle9i JDeveloper Web Services Stub/Skeleton Generator.
    * Date Created: Mon May 20 14:24:48 CEST 2002
    * WSDL URL: http://26.2.197.119:8888/InterOp/Services.wsdl
    public class AnagInquireServicesEJBStub {
    public String endpoint = "https://26.2.197.119/InterOp/AnagInquireServices";
    private OracleSOAPHTTPConnection m_httpConnection = null;
    public AnagInquireServicesEJBStub() {
    m_httpConnection = new OracleSOAPHTTPConnection();
    public Element ricercaPF(String istat1, String istat2, String codiceFiscale) throws Exception {
    System.setProperty("ssl.SocketFactory.provider","oracle.security.ssl.OracleSSLSocketFactoryImpl");
    System.setProperty("ssl.ServerSocketFactory.provider","oracle.security.ssl.OracleSSLServerSocketFactoryImpl");
    System.setProperty("java.protocol.handler.pkgs","HTTPClient");
    System.setProperty("oracle.wallet.location","C:\\temp\\exported_wallet");
    System.setProperty("oracle.wallet.password","camarda");
    Element returnVal = null;
    URL endpointURL = new URL(endpoint);
    Call call = new Call();
    call.setSOAPTransport(m_httpConnection);
    call.setTargetObjectURI("AnagInquireServices");
    call.setMethodName("ricercaPF");
    call.setEncodingStyleURI(Constants.NS_URI_LITERAL_XML);
    Vector params = new Vector();
    params.addElement(new Parameter("istat1", String.class, istat1, Constants.NS_URI_SOAP_ENC));
    params.addElement(new Parameter("istat2", String.class, istat2, Constants.NS_URI_SOAP_ENC));
    params.addElement(new Parameter("codiceFiscale", String.class, codiceFiscale, Constants.NS_URI_SOAP_ENC));
    call.setParams(params);
    Response response = call.invoke(endpointURL, "");
    if (!response.generatedFault()) {
    Parameter result = response.getReturnValue();
    returnVal = (Element)result.getValue();
    else {
    Fault fault = response.getFault();
    throw new SOAPException(fault.getFaultCode(), fault.getFaultString());
    return returnVal;
    public void setMaintainSession(boolean maintainSession) {
    m_httpConnection.setMaintainSession(maintainSession);
    public boolean getMaintainSession() {
    return m_httpConnection.getMaintainSession();
    public void setTransportProperties(Properties props) {
    m_httpConnection.setProperties(props);
    public Properties getTransportProperties() {
    return m_httpConnection.getProperties();
    public static void main( String args[] ) {
    AnagInquireServicesEJBStub a = new AnagInquireServicesEJBStub();
    try {
    XMLElement e = (XMLElement) a.ricercaPF("102030","102030","CMRGPP69M29D761K");
    e.print(System.out);
    } catch (Exception ex) {
    ex.printStackTrace();
    } finally {

  • Problem using WSDL from SAP in IBM's RAD for generating web service client

    When importing a WSDL from the ABAP stack on a SAP 6.40 system into IBM's RAD tool for generating a web service client there are errors with the soap fault classes that get generated.  The WSDL declares the types for the faults with WebServiceName.RfcException and these have elements of name, text, and message.  When the tools see this in the WSDL they generate classes that extend the Java exeception class and this causes an error because the "message" name conflicts with the standard java exception message.  Has anyone else ran into this problem?  It seems like a basic problem many java tools for generating web service client proxies would have because the soap faults get turned into java exceptions.  This name conflict of the java exception with the WSDL fault definition means that code always needs to be adjusted and cannot simply use the classes that are generated from the WSDL.  Anyone run across this or a similar problem in the java environment using the SAP WSDL?
    Aaron

    Hi,
    Hello again .
    Have you tried your service using soapui ?
    You can use your WSDL as input .
    In order to eliminate eclipse problem try this service:(I just did)
    http://www.oorsprong.org/websamples.countryinfo/CountryInfoService.wso?WSDL
    Regards.
    package main;
    import java.io.FileInputStream;
    import java.rmi.RemoteException;
    import java.util.Properties;
    import org.oorsprong.www.websamples_countryinfo.CountryInfoServiceSoapType;
    import org.oorsprong.www.websamples_countryinfo.CountryInfoServiceSoapTypeProxy;
    import org.oorsprong.www.websamples_countryinfo.TCountryCodeAndName;
    public class Main {
    public static void main(String[] args) {
      try {
       final Properties properties = new Properties();
       properties.load(new FileInputStream("properties.ini"));
       System.getProperties().putAll(properties);
      } catch (final Exception exception) {
       exception.printStackTrace();
      new Main();
    public Main() {
      try {
       final CountryInfoServiceSoapType infoServiceSoapType = new CountryInfoServiceSoapTypeProxy();
       final TCountryCodeAndName[] tCountryCodeAndNames = infoServiceSoapType.listOfCountryNamesByName();
       for (final TCountryCodeAndName tCountryCodeAndName : tCountryCodeAndNames) {
        System.out.println(tCountryCodeAndName.getSName());
      } catch (final RemoteException exception) {
       exception.printStackTrace();

  • Problem creating web service client using WSM Policies

    Hello everyone,
    I'm trying to make a simple java client to a Web Service secured using a WSM 11gR1 policy (from Soa Suite 11.1.1.2.0). The policy on the server side is oracle/wss11_x509_token_with_message_protection_service_policy which I attached via the Weblogic Admin Console. To implement the client I'm trying to follow the instructions from this documentation: http://download.oracle.com/docs/cd/E15523_01/web.1111/e13713/owsm_appendix.htm#WSSOV386 section "Policy Configuration Overrides for the Web Service Client" and also I'm using OEPE 11.1.1.3.0 (Eclipse 3.5.0) to develop the client. The only weblogic jar I've added to the build path is the weblogic.jar . Unfortunately, the oracle.wsm.security.util.SecurityConstants.ClientConstants interface (used in the example A-6) is not included in this jar and I have no idea what other libraries should I include in order to follow the example. I tried manualy adding other jars but without success. In fact I found one jar which includes this interface, the wsm-secpol.jar but it does not have the properties described in the documentation, so I guess it's not the right jar, and also I don't think this is the right procedure since there might be another dependent jars. So I would like to know what libraries exactly I should add to the build path (or some other procedure if you noticed I'm doing anything wrong)
    Thank you !

    Hi
    I am having the same problem almost where i wrote a client to comsume a JWS server in https. Where the server is setup to require a certificate to connect to.
    My code:
    public static void main(String[] args) {
    try {
    DataBaseSyncServerImpl port = new DataBaseSyncServerImplService().getDataBaseSyncServerImplPort();
    int number1 = 20;
    int number2 = 10;
    System.out.printf("Invoking divide method(%d, %d)\n", number1, number2);
    double result = port.divide(number1, number2);
    System.out.printf("The result of dividing %d and %d is %f.\n\n", number1, number2, result);
    when run this code throw
    run:
    [java] Invoking divide method(20, 10)
    [java] Exception in thread "main" javax.xml.ws.WebServiceException: HTTP transport error: javax.net.ssl.SSLHandshak
    eException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCert
    PathBuilderException: unable to find valid certification path to requested target
    Does any one know how can I solve this problem or how can I make the client be able to use self signed certificates. Any help is greatly apprecited. Thanks

  • 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

  • Is there a way to open a local file not a web file with actionscript 3.0?

    Reason for asking is because I am making a media player in Adobe Flash CS6, and was wondering if there was anyway to make a button to open a local .fla file in a directory with ActionScript 3.0 or if there are any other ways I can achieve this? Thank

  • Oracle 10G client Install on Windows

    We recently had our Oracle client upgraded from Oracle 9i to Oracle 10G. Now when we sign into the Oracle Enterprise Manager Console, select a user schema and right click on a table to View/Edit Contents, the records display but when i select a recor

  • Multiple numeric limit test

    Hi, I have a mutiple numeric limit test. I want to modify the measurement set in the test based on my needs. How to access the measurement set property of the test. when I do the export of the property using the property loader utility, the data is i

  • How to recognize Bluetooth model?

    I own hp elitebook 8560w and just made a clean system reinstall. Windows does not recognize any bluetooth devices, even though there is a bt module on board. However, I cannot determine what type it is. I looked into BIOS and found the following refe

  • I wish to add another ipod to my i-tunes so I can use one permanently in my car.

    I wish to add another Ipod to my i-tunes so that one can be used as a fixture in my car. Can I do this on the same i-tunes that i currently use. thanks