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

Similar Messages

  • How to pass SOAP Attachments with JAX-RPC Web Service

    I'm confused...
    This sample shows how to send/receive SOAP attachments by using the JAX-RPC Handler mechanism. Can somebody confirm if this is the preferred way to do this. I've seen an example wich does something like:
      public interface AttachmentService extends Remote {
        public String storeDocumentService(javax.activation.DataHandler dh, String filename) throws RemoteException;
      }and then uses JAX-RPC utilities to create wsdl, stubs and stuff. Does this have the same result, as what the OTN example shows (from an architecture perspective?
    Thx,
    Jan.

    Well, how an attachment is processed depends on your application logic...if your application logic requires to processing attachments and verify it before processing the SOAP message, handlers could be better option.
    If you need to process the attachment while processing the SOAP message, you can do it in the service implementation class.
    In both the cases you need to get access to SOAPMessage object and from there get the attachments with getAttachments method.

  • Batch operations with JAX-RPC

    I have read a number of different tutorials about Web services and JAX-RPC, and have to come the conclusion that JAX-RPC is the correct approach to use for my project. Most of the examples I have seen involve invoking services which perform a 'one-shot' action e.g. get a Stock Quote.
    My first question is that I am not sure for such 'one-shot' services, how much support there is in the API for sending/receiving arrays of data items. e.g. sending a user's data to a web service which includes an associated list of phone numbers.
    Further if I wanted to send user's data which included an array of nested objects, would I have to implement a serializer/deserialiser plugin?
    My main concern really is how best to handle a batch of requests to the service. My current thought is to use JAX-RPC with an xml document attachment - listing of a number of user's data and their parameters. A 'batch service' would return a response immediately then work through the document and invoke the existing 'single shot' service - which will be hosted on the same web server.
    Is this approach which brings together a number of different ideas from the various JAX-RPC tutorials viable? Are they any better alternatives?
    For example would it be better to implement a JAX-RPC for the single shot service requests and use JAXM for batch service requests? (On the server-side I would still be expecting the batch service to re-use the single-shot service). Can JAXM and JAX-RPC services co-exist on the same web server? I realise that there would be WSDL generated for the JAX-RPC service alone and so for a client developer there will be an inconsistency in terms of how the Web service is accessed.
    Thanks in anticipation

    Hello, I'll try and go through your questions one at a time:
    My first question is that I am not sure for such 'one-shot' services, how much support there is in the API for
    sending/receiving arrays of data items. e.g. sending a user's data to a web service which includes an
    associated list of phone numbers.JAX-RPC has built in support for List type operations. There is no problem sending Arrays of information over the wire. If you were sending an Object of type User, for instance, there would be no problem with User having a List of PhoneNumber types objects as part of it's structure.
    Further if I wanted to send user's data which included an array of nested objects, would I have to implement
    a serializer/deserialiser plugin?Condintional No. If the nested objects contained only data structures that JAX-RPC knows how to deal with, your fine (things like java.lang.String or java.lang.Integer). However, if your nested objects contain types that JAX-RPC does not know how to deal with (i.e. java.sql.TimeStamp), you will have to write a custom serializer/deserializer just like you would if you were passing those objects without them being nested.
    My main concern really is how best to handle a batch of requests to the service. My current thought is to
    use JAX-RPC with an xml document attachment - listing of a number of user's data and their parameters.
    A 'batch service' would return a response immediately then work through the document and invoke the
    existing 'single shot' service - which will be hosted on the same web server.
    Is this approach which brings together a number of different ideas from the various JAX-RPC tutorials
    viable? Are they any better alternatives?As per above you shouldn't have to send an xml document attachment, but I guess you could. Also, for batch processing type tasks you probably want to look at the asychronous mode mentioned in the JAX-RPC part of the JWSDP tutorial.
    For example would it be better to implement a JAX-RPC for the single shot service requests and use
    JAXM for batch service requests? (On the server-side I would still be expecting the batch service to re-use
    the single-shot service). Can JAXM and JAX-RPC services co-exist on the same web server? I realise
    that there would be WSDL generated for the JAX-RPC service alone and so for a client developer there
    will be an inconsistency in terms of how the Web service is accessed.Well, it really is up to you at this point. I assume that you want/need to use web services for access (as opposed to EJBs or any other method). So, I would look at an asychronous web service implementation.

  • Consuming a web service in Oracle9i with JAX-RPC calling

    Hello,
    i need to generate web service client in oracle9i db using jpublisher. And i found in this tutorial http://www.oracle.com/technology/sample_code/tech/java/jsp/callout_users_guide.htm that Oracle 9i is not supporting JAX-RPC web services calling, because of JDK 1.3.
    Is there any possibility to consume a web service using JAX-RPC instead of Oracle SOAP in Oracle 9.2 database ?

    I use utl_http pl/sql supplied package for this need - http://akdora.wordpress.com/2007/08/03/calling-a-web-service-by-plsql-utl_http/
    But I believe you may find more information with these resource -
    http://www.oracle.com/technology/sample_code/tech/java/web_services/index.html
    http://forums.oracle.com/forums/forum.jspa?forumID=97
    http://forums.oracle.com/forums/forum.jspa?forumID=99
    http://www.oracle.com/technology/sample_code/tech/java/jsp/dbwebservices.html
    Best regards.

  • 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

  • IP address of a remote client with JAX-RPC

    Hi all.
    I wrote a Web Service using JAX-RPC and I'd like to see the IP address of the machine requesting the methods exposed by the service.
    Is there any way to do this?
    Thanks
    Fabio

    I answare myself... let me know if this solution is good. tnx
    Fabio
    import javax.xml.rpc.server.*;
    import javax.xml.rpc.handler.MessageContext;
    import javax.servlet.http.HttpServletRequest;
    public class ServiceImpl implements ServiceIF, ServiceLifecycle {
         public void init(Object context) {
              ServletEndpointContext ctx = (ServletEndpointContext)context;
         public void foo() {
              MessageContext msgCtx = ctx.getMessageContext();
              HttpServletRequest req = (HttpServletRequest)msgCtx.getProperty("com.sun.xml.rpc.server.http.HttpServletRequest");
              String remoteIPAddress = req.getRemoteAddr();
    }

  • Using MIME with JAX-RPC

    Hi,
    I am trying to send simple MIME body part using RPC.
    Where can I find a working code sample ?
    My problem is that I don't know how to pass the SOAPContext to the server side.
    Or failing while trying to deliver an activation DataHandler as parameter to my server side method.
    What is the correct way to do that (without using messaging) ?
    Thanks,
    Eran B.

    Please do not refer me to:
    http://xml.apache.org/soap samples/mime/MimeTest*.java
    The sample does not implement fully this feature.

  • Problem with JAX-RPC tutorial

    I am studying "The JavaTM Web Services Tutorial"-Java API for XML-based RPC.
    When I read "Deploying the Service", I encounter some errors.
    I type "ant deploy".
    Here is error message:
    Buildfile: build.xml
    deploy:
    BUILD FAILED
    Total time: 3 seconds
    D:\jwsdp-1_0_01\docs\tutorial\examples\jaxrpc\hello\build.xml:14: java.io.FileNotFoundException: http://localhost:8080/manager/deploy?path=%2Fhello-jaxrpc
    I don't know what to do.I can't get any infomation from the tutorial.
    Please help me.Thanks.

    OK!
    I have solved this problem.
    I put build.properties in my home directory(On WinXP, C:\Documents and Settings\myProfile).
    The file looks like this:
    username=my_username
    password=my_password
    I think, when I deploy my web service to Tomcat, Tomcat need to verifiy my infomation. So, I must provide my authorization information to Tomcat.
    build.properties contains infomation which I provide.
    Read "Creating the Build Properties File" in JavaWSTutorial for more details

  • Document literal with JAX-RPC?

    Hi folks,
    I want to create a service that uses document literal. I'm at a loss as to how to specify this to wscompile or xrpcc.
    Any help would be greatly appreciated.
    Regards,
    Rajesh

    Hi Rajesh,
    I had the same problem last year when writing my master-degree paper. :>
    My solution is to serialize/deserialize every XML files before and after the parameters sent and received.
    However,this may be the most intuitive way to do it, but not the best way.
    If you have enough time, you may try to register your own encoding style,
    and assign the serialization job to your own serializer,
    to make the follow-up jobs easier.
    As I knew, some application servers would support literal-XML in their encoding style;One is MS-soap, and I forgot the other one.
    You may also migrate your ap. to the MS-soap to use the literal-XML as the input/output paras.
    Hope that would do help to your work.
    Regards,
    Jack

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

  • Problems with types using JAX-RPC

    Hi,
    I have to convert an RMI application into a JAX-RPC application. I thought it was easy but I have some problems with the parameter types and the return types of the remote methods.
    For example, how can I pass a java Object as a parameter or as a return type, supposing this object could be anything during runtime? Is there any way to do it because the only types one could use with JAX-RPC are not enough for my application.
    Regards,
    Vincent

    Thanks, that was my mistake.
    Instead of using wscompile, you must generate the stub classes with the WTK. Then, you set a reference to the j2me-ws.jar (JSR-172). No additional libraries from the Web Service Development Kit are required.

  • JAX-RPC and DataHandler

    Sorry, I know there has been lots of discussion about sending files with JAX-RPC in this forum, but I haven't found any answers to my problem.
    I got the impression that all I needed to do was to write a service having a DataHandler as a method parameter or a return type and JAX-RPC would automatically send it as attachment, but all I got was this error message:
    no serializer is registered for (class javax.activation.DataHandler, {http://java.sun.com/jax-rpc-ri/internal}datahandler)
    So what else I need to do to get this working? Is there any documentation explaining this, at least the Java Web Services Tutorial doesn't event mention the possibility of sending files.
    Heikki

    You can use DataHandler classes to add files to your web service messages. You would need to create a client side DataHandler and a server side DataHandler. The Web Service Tutorial doesn't say DataHandler but it is mentioned. Look at the web service tutorial for web service pack 1.3. Chapter 12 --> Advanced JAX-RPC Examples --> SOAP Message Handlers Example.
    The basic jist is you manually manipulate the soap message going back and forth.

  • What is the difference between RMI and JAX-RPC?

    Dear All
    First of all my understanding of RMI and JAX-RPC:
    RMI is JAVA only version of RPC. It can't talk to any other language.
    JAX-RPC is a part of JWSDP and if you implement your client and server with JAX-RPC, client written in any language can talk with JAX-RPC implementation.
    What else makes them different and am I right with my understanding?
    Finally, I would like to develop clients which will have a java class, say httpserver.java, which will act like a http server, listens to a http port. Now, Two such client will run in two different PC and I want to call a module from one client to another which should be accessible via my httpserver.java. For that which should be my choice RMI or JAX-RPC? Can I achive it with http get-post method, as I am expecting to read some value of variables from one client to the another.
    Say class A has variable a, aa, aaa and clas B has variable b, bb, bbb. Now I want to read the value of b, bb, bbb from class A. How do I do that when class B is listening to a http port with my httpserver.java class.
    Lastly, say B is listening to a http port and I want to send a file to B from A. How can I do that? Remember, B didn�t ask for that. How can A send a file to B when B is listening to a http port with my httpserver.java.
    With regards
    Mohammed Jubaer Arif
    Mobile: +61-0411215302
    Personal Web: http://www.geocities.com/jubairarifctg/
    Org. Web.: http://www.geocities.com/halimschamber/

    simply put, RMI allows you to (semi) transparently treat remote objects as if they were local, and your distributed application can be written (more or less) like a "normal" java app. Sockets just give you a "raw" connection to work with, and you get to build up your application from that.
    I hope that helped
    Lee

  • Sending attachments using JAX-RPC

    Hi,
    can anyone give me an example for sending an attachment using JAX-RPC. I want to create a webservice that will expect an attachment. Also once the client snds the attachment how can i access it in the service?
    any help will be apreciated. Thanks.

    Did anyone test this?
    I am using a DataHandler in the server
    public String sendDocument(String name, DataHandler dh)
    DataHandler rdh = (DataHandler) dh;
         if (dh == null)
              return message+ "Received null attachment";
         DataSource ds = rdh.getDataSource();
         try
              dh.writeTo(new FileOutputStream("D:\\temp\\" + name));
         catch(java.io.IOException e)
         return message + " Processed attachment " + ":Stream Error: " + e.getMessage();
         return message + " Processed attachment" ;
    In the client I use Proxy which works fine:
    FileDataSource fs = new FileDataSource(fileName);
    if (fs == null)
         System.out.println("Invalid File Source");
    DataHandler dhSource = new DataHandler(fs);
         System.out.println(up.sendDocument(dhSource.getName(), dhSource));
    THIS WORKS FINE. I see the attachment is saved properly.
    When I try using DII:
    call.setOperationName(new QName(BODY_NAMESPACE_VALUE,"sendDocument"));
    QName QNAME_TYPE_DH = new QName(NS_XSD, "DataHandler");
    call.addParameter("String_1", QNAME_TYPE_STRING,ParameterMode.IN);
    call.addParameter("DataHandler_1", QNAME_TYPE_DH,ParameterMode.IN);
    FileDataSource fs = new FileDataSource(fileName);
    if (fs == null)
         System.out.println("Invalid File Source");
    else
              DataHandler dhSource = new DataHandler(fs);
              String dhName = dhSource.getName();
         Object[] params = new Object[] {dhName,dhSource};
         String result = (String)call.invoke(params);
         System.out.println(result);
    THIS DOES NOT WORK. I get an error.
    [java] serialization error: no serializer is registered for (class javax.activation.DataHandler, {http://www.w3.org/2001/XMLSchema}DataHandler)
    ANY POINTERS??????
    I even tried this:
    QName qnameAttachment = new QName(NS_XSD, "DataHandler");
    TypeMappingRegistry tr = service.getTypeMappingRegistry();
    TypeMapping tm = tr.createTypeMapping();
    tm.register(DataHandler.class,
    qnameAttachment,
    new JAFDataHandlerSerializerFactory(),
    new JAFDataHandlerDeserializerFactory());
         tr.registerDefault(tm);
    NO SUCCESS!
    Appreciate any responses....

Maybe you are looking for

  • Hyper links do not work in mail

    Hi All,  Since updating OSX Hyper links do not work in .mail.  I can find no preferences that would affect this.

  • GetWorkflowDataForItem failed

    We are getting an error on all four SharePoint front-end servers several hundred times per day.  It looks like it is user initiated.  In other words, it looks like it happens when a user tries to do something rather than when the system tries to do s

  • Order History Problem

    When I log into my account and go to my order history nothing comes up. Ihave clicked on the "My Order History" multiple times and nothing happens. According to the instructions I received, if I need to reload my product all I have to do is click on

  • Getting data from infotype

    Hello Experts! I am a beginner in ABAP programming and I have problem with one of my task. I would like to get all users first and last names from infotype p0002. I've created a class, and method but only thing I've found in the Internet was somethin

  • Image Gallery Text Fields

    How do I change the font and size of text fields in creation of and image gallery?  I am able to change color.  I have Lightroom 3.  Thanks.