JAX-RPC Additional Sample Code

I am attempting to modify the JAX-RPC HelloWorld scripts to build my own custom application. Is there someplace I can look for more information on creating new JAX-RPC applications? The HelloWorld sample is somewhat limited in explaining what the build scripts are doing, and why.
Some documentation that describes the different requirements for J2EE app servers and Tomcat would also be helpful.

section 3.8 of http://java.sun.com/blueprints/guidelines/designing_webservices/html/ details the j2ee side of things

Similar Messages

  • Problems with jax-rpc HelloWorld sample

    Hi
    Running on Linux Red Hat 9.0
    Jwsdp 1.3
    I'm following the jwsdp tutorial trying to build the jax-rpc HelloWorld sample. I do what the tutorial says:
    "ant build" in the sample directory but it "Fails" with this message:
    init:
    [echo] -------- HelloWorld Sample --------
    prepare:
    generate-server:
    edit-config:
    [wscompile] modeler error: failed to parse document at "/home/medimg/pablo/jwsdp-1.3/jaxrpc/samples/HelloWorld//home/medimg/pablo/jwsdp-1.3/jaxrpc/samples/HelloWorl
    d/etc/HelloWorldService.wsdl": java.io.FileNotFoundException: /home/medimg/pablo/jwsdp-1.3/jaxrpc/samples/HelloWorld/home/medimg/pablo/jwsdp-1.3/jaxrpc/samples/Hell
    oWorld/etc/HelloWorldService.wsdl (No such file or directory)
    [wscompile] at com.sun.xml.rpc.processor.modeler.wsdl.WSDLModelerBase.buildModel(WSDLModelerBase.java:179)
    [wscompile] at com.sun.xml.rpc.processor.config.ModelInfo.buildModel(ModelInfo.java:85)
    [wscompile] at com.sun.xml.rpc.processor.Processor.runModeler(Processor.java:61)
    [wscompile] at com.sun.xml.rpc.tools.wscompile.CompileTool.run(CompileTool.java:564)
    [wscompile] at com.sun.xml.rpc.util.ToolBase.run(ToolBase.java:40)
    [wscompile] at com.sun.xml.rpc.tools.ant.Wscompile.execute(Wscompile.java:686)
    [wscompile] at org.apache.tools.ant.Task.perform(Task.java:341)
    [wscompile] at org.apache.tools.ant.Target.execute(Target.java:309)
    [wscompile] at org.apache.tools.ant.Target.performTasks(Target.java:336)
    [wscompile] at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
    [wscompile] at org.apache.tools.ant.Project.executeTargets(Project.java:1255)
    [wscompile] at org.apache.tools.ant.Main.runBuild(Main.java:609)
    [wscompile] at org.apache.tools.ant.Main.start(Main.java:196)
    [wscompile] at org.apache.tools.ant.Main.main(Main.java:235)
    [wscompile] CAUSE:
    [wscompile] failed to parse document at "/home/medimg/pablo/jwsdp-1.3/jaxrpc/samples/HelloWorld//home/medimg/pablo/jwsdp-1.3/jaxrpc/samples/HelloWorld/etc/HelloWorl
    dService.wsdl": java.io.FileNotFoundException: /home/medimg/pablo/jwsdp-1.3/jaxrpc/samples/HelloWorld/home/medimg/pablo/jwsdp-1.3/jaxrpc/samples/HelloWorld/etc/Hell
    oWorldService.wsdl (No such file or directory)
    [wscompile] at com.sun.xml.rpc.wsdl.parser.WSDLParser.parseDefinitionsNoImport(WSDLParser.java:252)
    [wscompile] at com.sun.xml.rpc.wsdl.parser.WSDLParser.parseDefinitions(WSDLParser.java:170)
    [wscompile] at com.sun.xml.rpc.wsdl.parser.WSDLParser.parse(WSDLParser.java:162)
    [wscompile] at com.sun.xml.rpc.processor.modeler.wsdl.WSDLModelerBase.buildModel(WSDLModelerBase.java:126)
    [wscompile] at com.sun.xml.rpc.processor.config.ModelInfo.buildModel(ModelInfo.java:85)
    [wscompile] at com.sun.xml.rpc.processor.Processor.runModeler(Processor.java:61)
    [wscompile] at com.sun.xml.rpc.tools.wscompile.CompileTool.run(CompileTool.java:564)
    [wscompile] at com.sun.xml.rpc.util.ToolBase.run(ToolBase.java:40)
    [wscompile] at com.sun.xml.rpc.tools.ant.Wscompile.execute(Wscompile.java:686)
    [wscompile] at org.apache.tools.ant.Task.perform(Task.java:341)
    [wscompile] at org.apache.tools.ant.Target.execute(Target.java:309)
    [wscompile] at org.apache.tools.ant.Target.performTasks(Target.java:336)
    [wscompile] at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
    [wscompile] at org.apache.tools.ant.Project.executeTargets(Project.java:1255)
    [wscompile] at org.apache.tools.ant.Main.runBuild(Main.java:609)
    [wscompile] at org.apache.tools.ant.Main.start(Main.java:196)
    [wscompile] at org.apache.tools.ant.Main.main(Main.java:235)
    [wscompile] CAUSE:
    [wscompile] java.io.FileNotFoundException: /home/medimg/pablo/jwsdp-1.3/jaxrpc/samples/HelloWorld/home/medimg/pablo/jwsdp-1.3/jaxrpc/samples/HelloWorld/etc/HelloWor
    ldService.wsdl (No such file or directory)
    [wscompile] at java.io.FileInputStream.open(Native Method)
    [wscompile] at java.io.FileInputStream.<init>(FileInputStream.java:106)
    [wscompile] at java.io.FileInputStream.<init>(FileInputStream.java:66)
    [wscompile] at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:69)
    [wscompile] at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:156)
    [wscompile] at java.net.URL.openStream(URL.java:913)
    [wscompile] at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:947)
    [wscompile] at org.apache.xerces.impl.XMLEntityManager.startEntity(XMLEntityManager.java:893)
    [wscompile] at org.apache.xerces.impl.XMLEntityManager.startDocumentEntity(XMLEntityManager.java:846)
    [wscompile] at org.apache.xerces.impl.XMLDocumentScannerImpl.setInputSource(XMLDocumentScannerImpl.java:264)
    [wscompile] at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:513)
    [wscompile] at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:595)
    [wscompile] at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152)
    [wscompile] at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:253)
    [wscompile] at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:206)
    [wscompile] at com.sun.xml.rpc.wsdl.parser.WSDLParser.parseDefinitionsNoImport(WSDLParser.java:248)
    [wscompile] at com.sun.xml.rpc.wsdl.parser.WSDLParser.parseDefinitions(WSDLParser.java:170)
    [wscompile] at com.sun.xml.rpc.wsdl.parser.WSDLParser.parse(WSDLParser.java:162)
    [wscompile] at com.sun.xml.rpc.processor.modeler.wsdl.WSDLModelerBase.buildModel(WSDLModelerBase.java:126)
    [wscompile] at com.sun.xml.rpc.processor.config.ModelInfo.buildModel(ModelInfo.java:85)
    [wscompile] at com.sun.xml.rpc.processor.Processor.runModeler(Processor.java:61)
    [wscompile] at com.sun.xml.rpc.tools.wscompile.CompileTool.run(CompileTool.java:564)
    [wscompile] at com.sun.xml.rpc.util.ToolBase.run(ToolBase.java:40)
    [wscompile] at com.sun.xml.rpc.tools.ant.Wscompile.execute(Wscompile.java:686)
    [wscompile] at org.apache.tools.ant.Task.perform(Task.java:341)
    [wscompile] at org.apache.tools.ant.Target.execute(Target.java:309)
    [wscompile] at org.apache.tools.ant.Target.performTasks(Target.java:336)
    [wscompile] at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
    [wscompile] at org.apache.tools.ant.Project.executeTargets(Project.java:1255)
    [wscompile] at org.apache.tools.ant.Main.runBuild(Main.java:609)
    [wscompile] at org.apache.tools.ant.Main.start(Main.java:196)
    [wscompile] at org.apache.tools.ant.Main.main(Main.java:235)
    [wscompile] error: modeler error: failed to parse document at "/home/medimg/pablo/jwsdp-1.3/jaxrpc/samples/HelloWorld//home/medimg/pablo/jwsdp-1.3/jaxrpc/samples/He
    lloWorld/etc/HelloWorldService.wsdl": java.io.FileNotFoundException: /home/medimg/pablo/jwsdp-1.3/jaxrpc/samples/HelloWorld/home/medimg/pablo/jwsdp-1.3/jaxrpc/sampl
    es/HelloWorld/etc/HelloWorldService.wsdl (No such file or directory)
    [wscompile] Command invoked: wscompile -d /home/medimg/pablo/jwsdp-1.3/jaxrpc/build/samples/HelloWorld/classes/server -import -keep -model /home/medimg/pablo/jwsdp-
    1.3/jaxrpc/build/samples/HelloWorld/model-wsdl-rpcenc.xml.gz -Xprintstacktrace /home/medimg/pablo/jwsdp-1.3/jaxrpc/samples/HelloWorld/etc/config.xml -classpath /hom
    e/medimg/pablo/jwsdp-1.3/jwsdp-shared/lib/mail.jar:/home/medimg/pablo/jwsdp-1.3/jwsdp-shared/lib/activation.jar:/home/medimg/pablo/jwsdp-1.3/jaxp/lib/jaxp-api.jar:/
    home/medimg/pablo/jwsdp-1.3/jaxp/lib/endorsed/dom.jar:/home/medimg/pablo/jwsdp-1.3/jaxp/lib/endorsed/sax.jar:/home/medimg/pablo/jwsdp-1.3/jaxp/lib/endorsed/xalan.ja
    r:/home/medimg/pablo/jwsdp-1.3/jaxp/lib/endorsed/xercesImpl.jar:/home/medimg/pablo/jwsdp-1.3/jaxrpc/lib/jaxrpc-api.jar:/home/medimg/pablo/jwsdp-1.3/jaxrpc/lib/jaxrp
    c-spi.jar:/home/medimg/pablo/jwsdp-1.3/jaxrpc/lib/jaxrpc-impl.jar:/home/medimg/pablo/jwsdp-1.3/saaj/lib/saaj-api.jar:/home/medimg/pablo/jwsdp-1.3/saaj/lib/saaj-impl
    .jar:/home/medimg/pablo/jwsdp-1.3/jwsdp-shared/lib/relaxngDatatype.jar:/home/medimg/pablo/jwsdp-1.3/jwsdp-shared/lib/xsdlib.jar:/home/medimg/pablo/jwsdp-1.3/jwsdp-s
    hared/lib/jax-qname.jar:/home/medimg/pablo/jwsdp-1.3/apache-ant/lib/ant.jar:/home/medimg/pablo/jwsdp-1.3/jaxrpc/samples/HelloWorld/${compile.classpath}
    BUILD FAILED
    file:/home/medimg/pablo/jwsdp-1.3/jaxrpc/samples/HelloWorld/build.xml:98: wscompile failed
    I took a look into the etc/config.xml file and the path location of HelloWorldService.wsdl is fine as follows
    "/home/medimg/pablo/jwsdp-1.3/jaxrpc/samples/HelloWorld/etc/HelloWorldService.wsdl"
    BUT.. after "ant build", the path in th config.xml file automatically change for:
    "/home/medimg/pablo/jwsdp-1.3/jaxrpc/samples/HelloWorld//home/medimg/pablo/jwsdp-1.3/jaxrpc/samples/HelloWorld/etc/HelloWorldService.wsdl"
    Anybody knows how to solve this problem
    HELP !!!
    J.Pablo

    Hi,
    I guess you need some changes in your build script.
    One solution would be to specify correct value for location attribute in your config.xml and then
    uncomment the call to "edit-config" target as show below in your build.xml file:
    <target name="generate-server" depends="prepare">
    <!--antcall target="edit-config">
    <param name="config.rpcenc.file" value="${config.rpcenc.file}"/>
    </antcall-->
    -Amol

  • How to use user-defined packages in JAX-RPC web service

    I am trying to use Object of my class located in my package in jax-rpc webservice,the code is
    package supercomputer;
    import Hello.*;
    public class SuperImpl implements SuperIF
    public String sendParam(String data)
    Temp ob=new Temp();
    int i=ob.get1(10000);
    return data+"returned by supercomputer";
    Temp is located in Hello package,I have jar the Hello package as Hello.jar and has set its classpath in targets.xml of Ant tool.
    The code compiles well and service is deployed successfully,but when i try to call the service from the client its gives me following error.
    [echo] Running the supercomputer.SuperClient program....
    [java] java.rmi.ServerException: Missing port information
    [java] at com.sun.xml.rpc.client.StreamingSender._raiseFault(StreamingSender.java:357)
    [java] at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:228)
    [java] at supercomputer.SuperIF_Stub.sendParam(SuperIF_Stub.java:60)
    [java] at supercomputer.SuperClient.main(Unknown Source)
    I dont know if it deploys why it gives error on client side.
    Please tell how to use user-defined packages and class in jax-rpc service code ,i am not talking about passing user-defined parameters i am just talking about making objects of user defined classes in jax-rpc service.I think there is some problem in classpath.
    Please guide me in doing that.
    Thanks,
    Farrukh

    Farrukh,
    I don't know if your error is about a missing class from your custom package, ... what track did you followed to say that?
    To use your package in the implementation of you web service, you should only follow the rules of making a web application: put your package jar in your \lib directory inside WEB-INF/ or your package classes unjared in classes (also in WEB-INF/).
    As I already said, I have doubts that your error should be originated from a missing class from your package, but:
    -try to see the logs (errors?) when you deploy your web service that could give a hint about the problem.
    -try to see if you can access your endpoint through your browser to see if there is a online status
    -display your config/WSDL file, and the steps you did to build your web service.
    regards,
    Pedro Salazar.

  • Deploy of jax-rpc sample  hello fails on jwsdp-1.2 Why ?

    Hi Friends,
    I am installed Jwsdp-1.2 on my machine.I am trying to
    deploy the hello sample which comes as part of jax-rpc.When i use the
    ant tool to deploy the war file i get the following error.
    C:\jwsdp-1.2\docs\tutorial\examples\jaxrpc\hello>ant deploy
    Buildfile: build.xml
    deploy:
    BUILD FAILED
    file:C:/jwsdp-1.2/docs/tutorial/examples/jaxrpc/common/targets.xml:14: java.io.IOException: Server returned HTTP response code: 401 for URL: http://localhost:8080/manager/deploy?path=%2Fhello-jaxrpc
    Why am i getting this error while deploying to tomact engine.Also,even
    if i try to access the url,
    http://localhost:8080/manager/deploy?path=%2Fhello-jaxrpc
    directly from the browser i get this error
    FAIL - Unknown command /deploy
    What should i do so as to deploy the sample jax-rpc hello program.Anyone
    knows about this please reply soon.Any help regarding this will be greatly appreciated.

    Error 401 means you're not authorised to view the page. Ant needs to know your username and password for Tomcat before it can access the deployment features.
    Go to http://java.sun.com/webservices/docs/1.0/tutorial/doc/GettingStarted2.html and follow the guidelines in the section "Creating the Build Properties File"

  • 503 error code when trying to access a weblogic jax-rpc webservice

    I'm going crazy on a webservice issue with Weblogic server 10.2.
    I have a DocumentRepository webservice deployed and I generated a JAX-RPC library based on its WSDL.
    Now I'm trying to access this webservice from Spring in a desktop application with the following bean declaration:
    <bean id="documentRepository" class="eu.europa.ec.rdg.efp.services.document.v1_00.DocumentRepository_Impl">
         <constructor-arg value="http://myserver.mycompany.com:7021/efpServices/DocumentRepository?WSDL" />
    </bean>
    But when the Spring application context initializes, after a few minutes, I get the following exception:
    javax.xml.rpc.ServiceException: Failed to parse WSDL http://myserver.mycompany.com:7021/efpServices/DocumentRepository?WSDL weblogic.wsee.wsdl.WsdlException: Failed to read wsdl file from url due to -- java.io.IOException: Server returned HTTP response code: 503 for URL: http://myserver.mycompany.com:7021/efpServices/DocumentRepository?WSDL
    +     at weblogic.wsee.jaxrpc.ServiceImpl.throwServiceException(ServiceImpl.java:174)+
    +     at weblogic.wsee.jaxrpc.ServiceImpl.loadWsdlDefinition(ServiceImpl.java:485)+
    +     at weblogic.wsee.jaxrpc.ServiceImpl.<init>(ServiceImpl.java:119)+
    +     at eu.europa.ec.rdg.efp.services.document.v1_00.DocumentRepository_Impl.<init>(Unknown Source)+
    +     at eu.europa.ec.rdg.efp.services.document.v1_00.DocumentRepository_Impl.<init>(Unknown Source)+
    +     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)+
    +     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)+
    +     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)+
    +     at java.lang.reflect.Constructor.newInstance(Constructor.java:513)+
    +     at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:100)+
    +     ... 35 more+
    Caused by: weblogic.wsee.wsdl.WsdlException: Failed to read wsdl file from url due to -- java.io.IOException: Server returned HTTP response code: 503 for URL: http://myserver.mycompany.com:7021/efpServices/DocumentRepository?WSDL
    +     at weblogic.wsee.wsdl.WsdlReader.getDocument(WsdlReader.java:313)+
    +     at weblogic.wsee.wsdl.WsdlDefinitions.parse(WsdlDefinitions.java:403)+
    +     at weblogic.wsee.wsdl.WsdlDefinitions.parse(WsdlDefinitions.java:389)+
    +     at weblogic.wsee.wsdl.WsdlFactory.parse(WsdlFactory.java:79)+
    +     at weblogic.wsee.wsdl.WsdlFactory.parse(WsdlFactory.java:66)+
    +     at weblogic.wsee.jaxrpc.ServiceImpl.loadWsdlDefinition(ServiceImpl.java:476)+
    +     ... 43 more+
    Caused by: java.io.IOException: Server returned HTTP response code: 503 for URL: http://myserver.mycompany.com:7021/efpServices/DocumentRepository?WSDL
    +     at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1305)+
    +     at weblogic.wsee.util.is.InputSourceUtil.loadURL(InputSourceUtil.java:100)+
    +     at weblogic.wsee.util.dom.DOMParser.getWebLogicDocumentImpl(DOMParser.java:118)+
    +     at weblogic.wsee.util.dom.DOMParser.getDocument(DOMParser.java:65)+
    +     at weblogic.wsee.wsdl.WsdlReader.getDocument(WsdlReader.java:311)+
    +     ... 48 more+
    Yet, I can see the WSDL in my browser when I go to http://myserver.mycompany.com:7021/efpServices/DocumentRepository?WSDL
    Now it looks a lot like a proxy issue, which is possible because I'm behind a proxy, and I had to set the following command-line parameters in order to access remote HTTP resources before the spring application context is initialized:
    -DproxySet=true -DproxyHost=<my proxy IP> -DproxyPort=8012
    And I authenticate to my proxy using the following code, once again before the Spring application context is initialized:
    Authenticator.setDefault(new Authenticator() {
                                       protected PasswordAuthentication getPasswordAuthentication() {
                                            return new PasswordAuthentication(<my login>, <my password>);
    Yet, those settings seem to have absolutely no effect on how the webservice client is loading the WSDL.
    So my question is the following: is it possible to specify a proxy to be used by the webservice client class to load the WSDL? If yes, how?
    On the other hand, if it was a proxy issue, then I guess the webservice client couldn't reach the server and I would get a connection timeout or something. But here I get a response, even though it's a 503 error. Any other idea where my exception comes from?
    I'm really desperate here. I've tried to ask our corporate weblogic support but they couldn't reproduce my issue. I've been fighting with this for weeks. Please help!

    Please, take a look at https://blogs.oracle.com/proactivesupportWCC/entry/clustering_and_high_availability_for (and contact the support group as advised)

  • Want to run jax-rpc sample from sun's webservice tutorial in the wls7

    hello
    i want to deploy the jax-rpc sample that come with the sun's tutorial(hello) and
    can works well in the tomcat into wls7,but the wls tell me that some files can't
    be found,then i add enough jar files under the jwsdp to the lib directory of the
    war package till the deployment success,but when i invoke it in the browser,the
    browser tell me "no jax-rpc context available",why?and the same package even can't
    be deployed in the jboss,the jboss always complain that the "class not found",but
    i am sure the classes is included in the lib jar files,why?who can help me?
    thank you

    Hello,
    Could you post a stack trace?
    Thanks,
    Bruce
    zbcong wrote:
    >
    hello
    i want to deploy the jax-rpc sample that come with the sun's tutorial(hello) and
    can works well in the tomcat into wls7,but the wls tell me that some files can't
    be found,then i add enough jar files under the jwsdp to the lib directory of the
    war package till the deployment success,but when i invoke it in the browser,the
    browser tell me "no jax-rpc context available",why?and the same package even can't
    be deployed in the jboss,the jboss always complain that the "class not found",but
    i am sure the classes is included in the lib jar files,why?who can help me?
    thank you

  • Newbie to attachment with JAX-RPC

    Hi,
    I am new to Web Services. I am developing a web services using oracle technology. I use JDeveloper 10g to create my web services using stateless Java class. Everything are so simple with clicking here and there to generate my WSDL file, web service stub and so on. Oracle use their own servlet as shown below.
    <servlet-name>MyWebService1</servlet-name>
    <servlet-class>oracle.j2ee.ws.StatelessJavaRpcWebService</servlet-class>I had created my interface and implements (Hello.java & HelloImpl.java respectively). Having a method public String sayHello(String param).
    Now, I want to send a attachment (or more than one) to the client using JAX-RPC. My problem now is don't-know-where-to-start. I have gone through a few example but most of the examples are so misleading. I understand that the endpoint of a web services is from servlet. Am I suppose to start my coding to attach the document(*.doc, *.pdf, and so on) to the SOAP object in my Hello.java or HelloImpl.java? Correct me if I am wrong.
    Anyone out there has a sample code of how-to send attachment with JAX-RPC with step-by-step (especially using oracle jdeveloper 10g if exist) article, if any?
    Please help, I am lost. Thanks in advance.
    regards,
    yientau

    Hi,
    I am new to Web Services. I am developing a web services using oracle technology. I use JDeveloper 10g to create my web services using stateless Java class. Everything are so simple with clicking here and there to generate my WSDL file, web service stub and so on. Oracle use their own servlet as shown below.
    <servlet-name>MyWebService1</servlet-name>
    <servlet-class>oracle.j2ee.ws.StatelessJavaRpcWebService</servlet-class>I had created my interface and implements (Hello.java & HelloImpl.java respectively). Having a method public String sayHello(String param).
    Now, I want to send a attachment (or more than one) to the client using JAX-RPC. My problem now is don't-know-where-to-start. I have gone through a few example but most of the examples are so misleading. I understand that the endpoint of a web services is from servlet. Am I suppose to start my coding to attach the document(*.doc, *.pdf, and so on) to the SOAP object in my Hello.java or HelloImpl.java? Correct me if I am wrong.
    Anyone out there has a sample code of how-to send attachment with JAX-RPC with step-by-step (especially using oracle jdeveloper 10g if exist) article, if any?
    Please help, I am lost. Thanks in advance.
    regards,
    yientau

  • How to compile and build a war file for JAX-RPC

    Hi all,
    I know that all who use JAX-RPC knows it.
    How to compile JAX-RPC code which was not the sample code of JWSDP example?.
    Which jar file is to be included in classpath?.
    After compiling,how to make a WAR file so i can deploy it in TOMCAT ...anyone plz

    Nobody answers.But i found a right article which was quite helpfull to do it.
    http://java.sun.com/developer/technicalArticles/WebServices/getstartjaxrpc/

  • JAX-RPC documentliteral with -model option problems in JWSDP 2.0

    Hello,
    I am trying to deploy a service generated with JAX-RPC. Howeverr when I write URL (http://localhost:8080/webservicedeployable/webservice001) in a browser I am getting message: 404 Not Found: Invalid request. Appending ?WSDL shows propers wsdl code, so endpoint URL is allright.. There is my config file delow:
    <?xml version="1.0" encoding="utf-8"?>
    <configuration xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/config">
      <service name="webservice001"
               targetNamespace="http://scdjws/webservices/wsdl"
               typeNamespace="http://scdjws/webservices/types"
               packageName="com.service001">
        <interface name="service.MyServicePort" servantName="service.MyServiceImpl"/>     
      </service> 
    </configuration>I am using command:
    wscompile -gen:server -f:documentliteral -s "C:\Documents and Settings\Michal\jbproject\mojservice\src\" -classpath WEB-INF/classes -d build -model webservice001.xml.gz config.xml -keepmy jaxrpc-ri.xml is:
    <?xml version="1.0" encoding="utf-8"?>
    <webServices xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/dd"
                 version="1.0"
                 targetNamespaceBase="http://java.sun.com/xml/ns/jax-rpc/wsi/wsdl"
                 typeNamespaceBase="http://java.sun.com/xml/ns/jax-rpc/wsi/types"
                 urlPatternBase="/ws">
      <endpoint name="service001"
                displayName="Service 001"
                description="This is service001"
                interface="service.MyServicePort"
                implementation="service.MyServiceImpl"
                model="/webservice001.xml.gz"/>
      <endpointMapping endpointName="service001"
                       urlPattern="/webservice001"/>
    </webServices>I am using Tomcat 5.5.16 and JWSDP 2.0.
    Making a call to the service throws exception:
    java.io.IOException: Server returned HTTP response code: 500 for URL: http://localhost:8080/webservicedeployable/webservice001
         at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:791)
    Thank you in advance for all suggestion.
    Michal

    Hi,
    I reselved the problem by just copying the FastInfoset to the jaxrpc\lib directory (I am sure this should work in a different way).
    Well, the next problem I am getting is that the "XMLStreamWriter" class cannot be found. This class is contained in jsr173_api.jar.
    I guess my main question is the following:
    Which projects are necessary to get this simple helloWorld example to work?
    I did set the JWSDP_HOME varible. Is there another setting I have to make to have all necessary jar-files available and to be able to run the samples?
    Could anybody point me to a tutorial that does not only show a few lines of code (as the HelloWorld sample in the JWSDP-Tutorial) but that would instead lead me through a step-by-step sample application that I write by myself and actually runs at the end? The example in the JWSDP-Tutorial uses all kinds of existing config files which are not explained.
    Thanks for your help.

  • Web Service JAX-RPC/SOAP with JAXB

    Hello,
    During my research on JAX-RPC/SOAP as web service technology. I found only simple "helloworld" sample type what using simple String as aurgment. For my task, I required a more complex aurgment such as a complete contact info. I then did some sample code for JAXB and found it to be very useful as a XML/JAVA binding tool. It seems logical to use JAXB to parse and bind the complex aurgment. Though I have not seen any reference to this using it with JAX-RPC. Does JAX-RPC have the tool set to accomplish the same thing? JAX-RPC may have such thing, but using this JAXB seem logical, thus would I still "conform" to the JAX-RPC if I go this route. Any info would be much appreciative.
    Thanks in Advance,
    Mike

    The two JAX-RPC tools that I have used, the reference implementation and Apache Axis both have tools for mappiing XML to classes and vice-versa. Having used JAXB also, I have to say that both of these tools are much easier to use than JAXB.
    As far as whether it will conform, you can make a valid SOAP message using any tool you like.

  • JAX-RPC - dynamic wsdl - non-built-in data types

    I thought my recent exp with developing a JAX-RPC client using a dynamic wsdl to communicate to a non-weblogic Web Service might help somebody out there. :-)
    JAX-RPC Mechanism in Weblogic for dynamic_wsdl seems to work only with built-in data types. Weblogic also supports non-built-in data types, but you need to do some extra work! For the user-defined objects, you need to generate their types and register them.
    Note: The samples given in Weblogic 8.1 do not use non-built-in data types!
    Make sure you use the ant task "autotype" in your build.xml to generate the appropriate types (objects to support java-xml and xml-java converstion), types.xml from the wsdl. Register the types.xml file in your calling client code.
    If you do not use register the types for the user-defined classes used in the web services method signatures, then you are likely to get the foll. exception.
    javax.xml.soap.SOAPException: failed to serialize interface javax.xml.soap.SOAPElementw
    eblogic.xml.schema.binding.SerializationException: mapping lookup failure. class=interface javax.xml
    .soap.SOAPElement class context=TypedClassContext{schemaType=['http://svcVodafonePooled.wsdlgen.jipi
    lot.vodafone.com']:getStock}
    C:\Tutorial\WS\dynamic_wsdl>ant run
    Buildfile: build.xml
    run:
    [java] Creating the service...
    [java] Creating the call...
    [java] invoking the call....
    [java] javax.xml.rpc.JAXRPCException: failed to invoke operation 'getStock' due to an error in
    the soap layer (SAAJ); nested exception is: Message[ failed to serialize interface javax.xml.soap.SO
    APElementweblogic.xml.schema.binding.SerializationException: mapping lookup failure. class=interface
    javax.xml.soap.SOAPElement class context=TypedClassContext{schemaType=['http://svcVodafonePooled.ws
    dlgen.jipilot.vodafone.com']:getStock}]StackTrace[
    [java] javax.xml.soap.SOAPException: failed to serialize interface javax.xml.soap.SOAPElementw
    eblogic.xml.schema.binding.SerializationException: mapping lookup failure. class=interface javax.xml
    .soap.SOAPElement class context=TypedClassContext{schemaType=['http://svcVodafonePooled.wsdlgen.jipi
    lot.vodafone.com']:getStock}
    [java] at weblogic.webservice.core.DefaultPart.invokeSerializer(DefaultPart.java:328)
    [java] at weblogic.webservice.core.DefaultPart.toXML(DefaultPart.java:297)
    [java] at weblogic.webservice.core.DefaultMessage.toXML(DefaultMessage.java:645)
    [java] at weblogic.webservice.core.ClientDispatcher.send(ClientDispatcher.java:206)
    [java] at weblogic.webservice.core.ClientDispatcher.dispatch(ClientDispatcher.java:143)
    [java] at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:457)
    [java] at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:443)
    [java] at weblogic.webservice.core.rpc.CallImpl.invoke(CallImpl.java:558)
    [java] at weblogic.webservice.core.rpc.CallImpl.invoke(CallImpl.java:411)
    [java] at Main.main(Main.java:61)
    [java] Caused by: weblogic.xml.schema.binding.SerializationException: mapping lookup failure. c
    lass=interface javax.xml.soap.SOAPElement class context=TypedClassContext{schemaType=['http://svcVod
    afonePooled.wsdlgen.jipilot.vodafone.com']:getStock}
    [java] at weblogic.xml.schema.binding.RuntimeUtils.lookup_serializer(RuntimeUtils.java:151)
    [java] at weblogic.xml.schema.binding.RuntimeUtils.invoke_serializer(RuntimeUtils.java:187)
    [java] at weblogic.xml.schema.binding.RuntimeUtils.invoke_serializer(RuntimeUtils.java:174)
    [java] at weblogic.webservice.core.DefaultPart.invokeSerializer(DefaultPart.java:324)
    [java] ... 9 more
    [java] ]
    [java] at weblogic.webservice.core.rpc.CallImpl.invoke(CallImpl.java:578)
    [java] at weblogic.webservice.core.rpc.CallImpl.invoke(CallImpl.java:411)
    [java] at Main.main(Main.java:61)
    [java] Exception in thread "main"
    [java] Java Result: 1

    The foll. code worked fine for me in Weblogic 8.1 SP3, on Windows 2000.
    Note: the 2 important lines of code:
    TypeMappingRegistry registry service.getTypeMappingRegistry();
    registry.registerDefault(new DefaultTypeMapping("types.xml"));
    package auth;
    import java.net.URL;
    import javax.xml.rpc.ServiceFactory;
    import javax.xml.rpc.Service;
    import javax.xml.rpc.Call;
    import javax.xml.rpc.ParameterMode;
    import javax.xml.namespace.QName;
    import javax.xml.rpc.encoding.TypeMapping;
    import javax.xml.rpc.encoding.TypeMappingRegistry;
    import weblogic.webservice.core.encoding.stream.SOAPElementCodec;
    import javax.xml.rpc.encoding.*;
    import weblogic.webservice.encoding.DefaultTypeMapping;
    public class DClient1 {
    static private void print(String msg) {
         System.out.println("DClient1: " + msg);
    public static void main(String[] argv) throws Exception {
    System.setProperty("javax.xml.soap.MessageFactory", "weblogic.webservice.core.soap.MessageFactoryImpl");
    System.setProperty( "javax.xml.rpc.ServiceFactory", "weblogic.webservice.core.rpc.ServiceFactoryImpl");
    ServiceFactory factory = ServiceFactory.newInstance();
    String targetNamespace = "http://www.vishwa.com/amazingworld";
    QName serviceName = new QName(targetNamespace, "GeminiPasswordService");
    QName portName = new QName(targetNamespace, "GeminiPasswordServicePort");
    QName operationName = new QName("", "checkPassword");
    URL wsdlLocation = new URL("http://localhost:7001/GeminiPasswordService/GeminiPasswordService?WSDL");
         print("Creating the service...");
    Service service = factory.createService(wsdlLocation, serviceName);
         print("Creating the call...");
    Call call = service.createCall(portName, operationName);
         TypeMappingRegistry registry = service.getTypeMappingRegistry();
         registry.registerDefault(new DefaultTypeMapping("types.xml"));
         print("invoking the call....");
    Object[] inParams = new Object[2];
    inParams[0] = "clark1";
    inParams[1] = "kent1";
    Object result = call.invoke(inParams);
    print("Client return value: = " + result.toString());
    QName operationName1 = new QName("", "getBook");
    print("Creating the call...");
    Call call1 = service.createCall(portName, operationName1);
    print("invoking the call....");
    Name n = new Name();
         n.setFirstname("Walker");
         n.setAge(50);
         Object[] inParams1 = new Object[1];
         inParams1[0] = n;
    Book b = (Book) call1.invoke(inParams1);
    print("author: " + b.getAuthor());
    print("money: " + b.getMoney());
    }

  • Using DII in JAX-RPC

    I've been trying to connect (unsuccessfully so far) to a webservice using DII in JAX-RPC. Was able to connect to the said webservice successfully using static stubs. But our requirement is for dynamic invocation. Sorry if a topic like this has been posted already. I did search the forums but couldn't find the answer to my problem.
    The WSDL for the web service is as follows:
    <?xml version="1.0" encoding="utf-8"?>
    <definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="http://secure.yehey.com/2003/01/PayPlus" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://secure.yehey.com/2003/01/PayPlus" xmlns="http://schemas.xmlsoap.org/wsdl/">
    <types>
    <s:schema elementFormDefault="qualified" targetNamespace="http://secure.yehey.com/2003/01/PayPlus">
    <s:element name="Process">
    <s:complexType>
    <s:sequence>
    <s:element minOccurs="0" maxOccurs="1" name="inpData" type="s:string" />
    </s:sequence>
    </s:complexType>
    </s:element>
    <s:element name="ProcessResponse">
    <s:complexType>
    <s:sequence>
    <s:element minOccurs="0" maxOccurs="1" name="ProcessResult" type="s:string" />
    </s:sequence>
    </s:complexType>
    </s:element>
    <s:element name="GetStatus">
    <s:complexType>
    <s:sequence>
    <s:element minOccurs="0" maxOccurs="1" name="inxml" type="s:string" />
    </s:sequence>
    </s:complexType>
    </s:element>
    <s:element name="GetStatusResponse">
    <s:complexType>
    <s:sequence>
    <s:element minOccurs="0" maxOccurs="1" name="GetStatusResult" type="s:string" />
    </s:sequence>
    </s:complexType>
    </s:element>
    <s:element name="GetRedirectURL">
    <s:complexType>
    <s:sequence>
    <s:element minOccurs="0" maxOccurs="1" name="inpURL" type="s:string" />
    </s:sequence>
    </s:complexType>
    </s:element>
    <s:element name="GetRedirectURLResponse">
    <s:complexType>
    <s:sequence>
    <s:element minOccurs="0" maxOccurs="1" name="GetRedirectURLResult" type="s:string" />
    </s:sequence>
    </s:complexType>
    </s:element>
    <s:element name="string" nillable="true" type="s:string" />
    </s:schema>
    </types>
    <message name="ProcessSoapIn">
    <part name="parameters" element="s0:Process" />
    </message>
    <message name="ProcessSoapOut">
    <part name="parameters" element="s0:ProcessResponse" />
    </message>
    <message name="GetStatusSoapIn">
    <part name="parameters" element="s0:GetStatus" />
    </message>
    <message name="GetStatusSoapOut">
    <part name="parameters" element="s0:GetStatusResponse" />
    </message>
    <message name="GetRedirectURLSoapIn">
    <part name="parameters" element="s0:GetRedirectURL" />
    </message>
    <message name="GetRedirectURLSoapOut">
    <part name="parameters" element="s0:GetRedirectURLResponse" />
    </message>
    <message name="ProcessHttpGetIn">
    <part name="inpData" type="s:string" />
    </message>
    <message name="ProcessHttpGetOut">
    <part name="Body" element="s0:string" />
    </message>
    <message name="GetStatusHttpGetIn">
    <part name="inxml" type="s:string" />
    </message>
    <message name="GetStatusHttpGetOut">
    <part name="Body" element="s0:string" />
    </message>
    <message name="GetRedirectURLHttpGetIn">
    <part name="inpURL" type="s:string" />
    </message>
    <message name="GetRedirectURLHttpGetOut">
    <part name="Body" element="s0:string" />
    </message>
    <message name="ProcessHttpPostIn">
    <part name="inpData" type="s:string" />
    </message>
    <message name="ProcessHttpPostOut">
    <part name="Body" element="s0:string" />
    </message>
    <message name="GetStatusHttpPostIn">
    <part name="inxml" type="s:string" />
    </message>
    <message name="GetStatusHttpPostOut">
    <part name="Body" element="s0:string" />
    </message>
    <message name="GetRedirectURLHttpPostIn">
    <part name="inpURL" type="s:string" />
    </message>
    <message name="GetRedirectURLHttpPostOut">
    <part name="Body" element="s0:string" />
    </message>
    <portType name="PayplusSoap">
    <operation name="Process">
    <input message="s0:ProcessSoapIn" />
    <output message="s0:ProcessSoapOut" />
    </operation>
    <operation name="GetStatus">
    <input message="s0:GetStatusSoapIn" />
    <output message="s0:GetStatusSoapOut" />
    </operation>
    <operation name="GetRedirectURL">
    <input message="s0:GetRedirectURLSoapIn" />
    <output message="s0:GetRedirectURLSoapOut" />
    </operation>
    </portType>
    <portType name="PayplusHttpGet">
    <operation name="Process">
    <input message="s0:ProcessHttpGetIn" />
    <output message="s0:ProcessHttpGetOut" />
    </operation>
    <operation name="GetStatus">
    <input message="s0:GetStatusHttpGetIn" />
    <output message="s0:GetStatusHttpGetOut" />
    </operation>
    <operation name="GetRedirectURL">
    <input message="s0:GetRedirectURLHttpGetIn" />
    <output message="s0:GetRedirectURLHttpGetOut" />
    </operation>
    </portType>
    <portType name="PayplusHttpPost">
    <operation name="Process">
    <input message="s0:ProcessHttpPostIn" />
    <output message="s0:ProcessHttpPostOut" />
    </operation>
    <operation name="GetStatus">
    <input message="s0:GetStatusHttpPostIn" />
    <output message="s0:GetStatusHttpPostOut" />
    </operation>
    <operation name="GetRedirectURL">
    <input message="s0:GetRedirectURLHttpPostIn" />
    <output message="s0:GetRedirectURLHttpPostOut" />
    </operation>
    </portType>
    <binding name="PayplusSoap" type="s0:PayplusSoap">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
    <operation name="Process">
    <soap:operation soapAction="http://secure.yehey.com/2003/01/PayPlus/Process" style="document" />
    <input>
    <soap:body use="literal" />
    </input>
    <output>
    <soap:body use="literal" />
    </output>
    </operation>
    <operation name="GetStatus">
    <soap:operation soapAction="http://secure.yehey.com/2003/01/PayPlus/GetStatus" style="document" />
    <input>
    <soap:body use="literal" />
    </input>
    <output>
    <soap:body use="literal" />
    </output>
    </operation>
    <operation name="GetRedirectURL">
    <soap:operation soapAction="http://secure.yehey.com/2003/01/PayPlus/GetRedirectURL" style="document" />
    <input>
    <soap:body use="literal" />
    </input>
    <output>
    <soap:body use="literal" />
    </output>
    </operation>
    </binding>
    <binding name="PayplusHttpGet" type="s0:PayplusHttpGet">
    <http:binding verb="GET" />
    <operation name="Process">
    <http:operation location="/Process" />
    <input>
    <http:urlEncoded />
    </input>
    <output>
    <mime:mimeXml part="Body" />
    </output>
    </operation>
    <operation name="GetStatus">
    <http:operation location="/GetStatus" />
    <input>
    <http:urlEncoded />
    </input>
    <output>
    <mime:mimeXml part="Body" />
    </output>
    </operation>
    <operation name="GetRedirectURL">
    <http:operation location="/GetRedirectURL" />
    <input>
    <http:urlEncoded />
    </input>
    <output>
    <mime:mimeXml part="Body" />
    </output>
    </operation>
    </binding>
    <binding name="PayplusHttpPost" type="s0:PayplusHttpPost">
    <http:binding verb="POST" />
    <operation name="Process">
    <http:operation location="/Process" />
    <input>
    <mime:content type="application/x-www-form-urlencoded" />
    </input>
    <output>
    <mime:mimeXml part="Body" />
    </output>
    </operation>
    <operation name="GetStatus">
    <http:operation location="/GetStatus" />
    <input>
    <mime:content type="application/x-www-form-urlencoded" />
    </input>
    <output>
    <mime:mimeXml part="Body" />
    </output>
    </operation>
    <operation name="GetRedirectURL">
    <http:operation location="/GetRedirectURL" />
    <input>
    <mime:content type="application/x-www-form-urlencoded" />
    </input>
    <output>
    <mime:mimeXml part="Body" />
    </output>
    </operation>
    </binding>
    <service name="Payplus">
    <port name="PayplusSoap" binding="s0:PayplusSoap">
    <soap:address location="https://secured.teamyehey.com/payplus/services/payplus.asmx" />
    </port>
    <port name="PayplusHttpGet" binding="s0:PayplusHttpGet">
    <http:address location="https://secured.teamyehey.com/payplus/services/payplus.asmx" />
    </port>
    <port name="PayplusHttpPost" binding="s0:PayplusHttpPost">
    <http:address location="https://secured.teamyehey.com/payplus/services/payplus.asmx" />
    </port>
    </service>
    </definitions>
    My code to access the above webservice (for Process method) is as follows (which is almost an exact copy from the sample code in JWSDP tutorial) :
    String qnameService = "Payplus";
    String qnamePort = "PayplusSoap";
    String BODY_NAMESPACE_VALUE = "http://secure.yehey.com/2003/01/PayPlus";
    String ENCODING_STYLE_PROPERTY = "javax.xml.rpc.encodingstyle.namespace.uri";
    String NS_XSD = "http://www.w3.org/2001/XMLSchema";
    String URI_ENCODING = "http://schemas.xmlsoap.org/soap/encoding/";
    ServiceFactory factory = ServiceFactory.newInstance();
    Service service = factory.createService(new QName(qnameService));
    QName port = new QName(qnamePort);
    Call call = service.createCall(port);
    call.setTargetEndpointAddress(urlstring);
    call.setProperty(Call.SOAPACTION_USE_PROPERTY, new Boolean(true));
    call.setProperty(Call.SOAPACTION_URI_PROPERTY, "http://secure.yehey.com/2003/01/PayPlus/Process");
    call.setProperty(ENCODING_STYLE_PROPERTY, URI_ENCODING);
    QName QNAME_TYPE_STRING = new QName(NS_XSD, "string");
    call.setReturnType(QNAME_TYPE_STRING);
    call.setOperationName(new QName(BODY_NAMESPACE_VALUE, "Process"));
    call.addParameter("inpData", QNAME_TYPE_STRING, ParameterMode.IN);
    String[] params = { getProcessString() }; // getProcessString here returns the parameter required
    String result = (String)call.invoke(params);
    System.out.println(result);
    The error that I keep on getting is this:
    java.rmi.RemoteException: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.ArgumentNullException: Value cannot be null.
    Parameter name: s
    at System.IO.StringReader..ctor(String s)
    at Payplus.Payplus.Process(String inpData)
    Any help would be greatly appreciated. Thanks!

    Are you using the JAXRPC implementation from java.sun.com
    for your client invocations? IThis may be an implementation problem
    and if you are not using the sun implementation, then I can not explain
    the exception-
    kathy

  • Use Array in JAX-RPC

    I want to send an array as parameter in the client of the JAX-RPC,how can I write the code?
    Here is my code,but it has some errors.
    int[] temp=new int[2];
    temp[0]=1;
    temp[1]=2;
    QName QNAME_TYPE_OBJECT = new QName("http://schemas.xmlsoap.org/soap/encoding/", "Array");
    call.addParameter("param", QNAME_TYPE_OBJECT,temp.getClass(), ParameterMode.PARAM_MODE_IN);
    Object[] params = {temp};
    String result = (String)call.invoke(params);
    How can I send the temp array correctly?
    thank you very much!

    In addition ,I find that if I change the parameter from int[] to String[],everything is ok!
    here is the code:
    String[] words = {"it", "was", "a", "dark", "and",     
    "stormy", "night"};
    QName QNAME_TYPE_OBJECT = new QName("http://schemas.xmlsoap.org/soap/encoding/", "Array");
    call.addParameter("param", QNAME_TYPE_OBJECT,words.getClass(), ParameterMode.PARAM_MODE_IN);
    Object[] params = {words};
    String result = (String)call.invoke(params);
    why?what I happenend?And I find that the error is that ClassCastError,i.e.
    String[] can be casted into Object[],but int[] can't,so the error occured.(I know this process by decompiling the class file).
    but the tutorial says JAX-rpc supports the int[],is it wrong?

  • JAX-RPC Client Handler

    Hi All,
    I am trying to get a simple example client handler to work using JAX-RPC DII.
    The web serivice is a simple one that just returns Hello + name..
    Here is the client code:
    public class Main {
         * @param args the command line arguments
        private static String BODY_NAMESPACE_VALUE = "http://helloservice/";
        private static String NS_XSD = "http://www.w3.org/2001/XMLSchema";
        private static String ENCODING_STYLE_PROPERTY = "javax.xml.rpc.encodingstyle.namespace.uri";
        private static String URI_ENCODING ="http://schemas.xmlsoap.org/soap/encoding/";
        public static void main(String[] args) {
            try {
                     String url ="http://localhost:8080/HelloService/MyHelloService";
                     QName serviceName   = new QName(BODY_NAMESPACE_VALUE,"MyHelloServiceService");
                     QName portTypeName = new QName(BODY_NAMESPACE_VALUE, "MyHelloServicePort");
                     ServiceFactory factory = ServiceFactory.newInstance();
                     Service service = factory.createService(serviceName);
                     Call call = service.createCall();
                     call.setPortTypeName(portTypeName);
                     call.setOperationName(new QName(BODY_NAMESPACE_VALUE, "sayHello"));
                     call.setTargetEndpointAddress(url);
                     call.setProperty(ENCODING_STYLE_PROPERTY,"");
                     //call.setProperty(ENCODING_STYLE_PROPERTY,URI_ENCODING);
                     call.setProperty(Call.OPERATION_STYLE_PROPERTY, "rpc");
                     QName QNAME_TYPE_STRING = new QName(NS_XSD, "string");
                     call.setReturnType(QNAME_TYPE_STRING);
                     call.addParameter("name", QNAME_TYPE_STRING, ParameterMode.IN);
                     String[] params = { "Murph!" };
                     HandlerRegistry hr = service.getHandlerRegistry();
                     List<HandlerInfo> list = new ArrayList<HandlerInfo>();
                     HandlerInfo hi = new HandlerInfo(ClientSOAPHandler1.class, null,null);
                     list.add(hi);
                     HandlerInfo hi2 = new HandlerInfo(ClientLogicalHandler1.class, null,null);
                     list.add(hi2);
                     hr.setHandlerChain(portTypeName, list);
                     String result = (String)call.invoke(params);
                     System.out.println(result);
            } catch (ServiceException e)
                e.printStackTrace();
            catch (RemoteException e)
                e.printStackTrace();
    }And the code for the Handlers:
    public class ClientSOAPHandler1 extends ClientSOAPHandlerBase
        private final String HANDLERNAME="ClientSOAPHandler1";
        public ClientSOAPHandler1(){
           super();
           super.setHandlerName(HANDLERNAME);
    import javax.xml.transform.Source;
    import java.util.Set;
    import java.util.TreeSet;
    import javax.annotation.PreDestroy;
    import javax.annotation.PostConstruct;
    import javax.xml.namespace.QName;
    import javax.xml.ws.handler.MessageContext;
    import javax.xml.ws.handler.soap.SOAPHandler;
    import javax.xml.ws.handler.soap.SOAPMessageContext;
    import javax.xml.soap.SOAPMessage;
    import java.io.ByteArrayOutputStream;
    public class ClientSOAPHandlerBase implements SOAPHandler<SOAPMessageContext>
        private String handlerName=null;
        public void setHandlerName(String h) {
            this.handlerName=h;
        public String getHandlerName() {
            return this.handlerName;
        @PostConstruct
        public void myInit() {
            System.out.println("------------------------------------");
            System.out.println("in "+handlerName+":myInit");
            System.out.println("exiting "+handlerName+":myInit");
            System.out.println("------------------------------------");
        @PreDestroy
        public void myDestroy() {
            System.out.println("------------------------------------");
            System.out.println("in "+handlerName+":myDestroy");
            System.out.println("exiting "+handlerName+":myDestroy");
            System.out.println("------------------------------------");
        public Set<QName> getHeaders() {
            return new TreeSet<QName>();
        public boolean handleMessage(SOAPMessageContext context) {
            System.out.println("------------------------------------");
            System.out.println("in "+handlerName+":handleMessage");
            boolean direction= ((Boolean)context.get(SOAPMessageContext.MESSAGE_OUTBOUND_PROPERTY)).booleanValue();
            if (direction) {
                System.out.println("direction = outbound");
            } else {
                System.out.println("direction = inbound");
            dumpMsg(context);
            System.out.println("exiting "+handlerName+":handleMessage");
            System.out.println("------------------------------------");
            return true;
        public void close(MessageContext context) {
            System.out.println("------------------------------------");
            System.out.println("in "+handlerName+":close");
            System.out.println("exiting "+handlerName+":close");
            System.out.println("------------------------------------");
        public boolean handleFault(SOAPMessageContext context) {
            System.out.println("------------------------------------");
            System.out.println("in "+handlerName+":handleFault");
            System.out.println("exiting "+handlerName+":handleFault");
            System.out.println("------------------------------------");
            return true;
        public void dumpMsg(MessageContext context) {
           try {
              SOAPMessage soapmsg = ((SOAPMessageContext)context).getMessage();
              System.out.println("MSG="+getMsgAsString(soapmsg));
           } catch (Exception e) {
               e.printStackTrace();
           return;
        public String getMsgAsString(SOAPMessage message) {
            String msg  = null;
            try {
                ByteArrayOutputStream baos = new ByteArrayOutputStream();
                message.writeTo(baos);
                msg = baos.toString();
            } catch (Exception e) {
                e.printStackTrace();
            return msg;
    }The output is as follows:
    run:
    Hello Murph!
    BUILD SUCCESSFUL (total time: 1 second)
    This should print out the various println statements in the Handler, but it doesnt :(- How come? What am I missing?
    I have searched everywhere trying to find the proper way to get a client side handler to work and have had luck. Additionally, I really really need this to work....if anyone could provide help, it would be VERY appreciated...pretty please
    Thanks,
    Daniel

    Any Ideas Anyone?????

  • Report Engine SDK sample code questions

    Hello,
    I've been able to view a boxi report in an iframe via the Enterprise SDK by modifying the sample code in the HowToViewWebiReports_VB example.
    I'm not totally happy with the way that's working, so I'm looking at using the Report Engine SDK, although I understand it's performance and scalability isn't quite as good as the Enterprise SDK.
    I'm a VB.NET guy, not a C# guy, and I'm not clear on how the wssdk_net2.0_portal_sample_12.0_en example is supposed to work.
    I don't have one and my CMS server is running Tomcat, not IIS so there's not going to be an ASP.NET web service running there.
    In the dsws.config for the wssdk_net2.0_portal_sample_12.0_en example I put the name of the CMS server, but it's looking for a web service at http://cmsservername:8080/dswsbobje/services/Session, but I get a 404 when i try to hit that. 
    I'm not familiar with Tomcat, but in searching around on the server, I see a dswsbobje directory under the webapps in my Tomcat installation, but I don't see a services or a Session folder underneath that.  In the dswsbobje folder I see the following folders:
    BOAR-INF
    META-INF
    WEB-INF
    xsd
    Is there something else that needs to be installed on the Tomcat server to get the web service running?
    -Eric

    It looks like I have something there.  When I launch launch http://servername:8080/dswsbobje,  I see:
    Apache-AXIS
    Hello! Welcome to Apache-Axis.
    What do you want to do today?
    Validate the local installation's configuration
    see below if this does not work.
    To enable the disabled features, uncomment the appropriate declarations in WEB-INF/web.xml in the webapplication and restart it.
    Validating Axis
    If the "happyaxis" validation page displays an exception instead of a status page, the likely cause is that you have multiple XML parsers in your classpath. Clean up your classpath by eliminating extraneous parsers.
    I clicked on the "Validate" link and I see:
    Axis Happiness Page
    Examining webapp configuration
    QaaWS Configuration
    QaaWS Servlet is not valid.
    ErrorServer servername not found or server may be down
    See Web Application log to get more info or read QaaWS v2 documentation starting with section
    Perhaps this environment needs some additional configuration?

Maybe you are looking for

  • Printing Problems since upgrading to 10.5.6

    We are having problems printing since updating to 10.5.6 1. We have a HP5000 black & white printer and when we print to it straight from InDesign CS3 it will enlarge the the job. We have to make a pdf then print from Acrobat. (We are connected by App

  • Create Object for archiving Custom Table

    Hi guru!! I have a problem, I must create a archiving object for custom table.. I must create a report for READ, DELETE and ARCHIVING this type of table.. colud you help me? thanks a lot guru!!!

  • Output types for script

    Hi All pls tell output types and script name and driver program for 1.packing llist for export customer 2.addtional dunning lever (level3) pls geve reply fot that Regards M.Srinvas

  • Creating ABAP class in XI for ABAP mapping

    Hi All, While creating ABAP class in SE80 XI I am getting following message. “You are not registered as a developer. Please register in the Online Service System (OSS). In the OSS you will receive an access key.” Plz guide which role I required to do

  • Mac OSX lion issue sound [Audio Stops Work]

    Hi. I have a mac book pro with mac os x lion, and something make my sound stops WORK! i unninstal the mac keeper but the problem was nor solved [I read this in another forum] When I play some sound a red light on the mini-jack port is turned on. The