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.

Similar Messages

  • 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

  • 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

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

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

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

  • Web Service  Stateless Session request using JDeveloepr 11g (JAX-RPC)

    I have been trying to consume web Service by sending Stateless Session request to the system.
    I generated the Java Proxy using JDeveloepr 11g, using JAX-RPC.
    As it is Stateless I need to add following SOAP Header for authentication
    <soap:Header>
    <wsse:Security soap:mustUnderstand="1">
    <wsse:UsernameToken>
    <wsse:Username>[email protected]</wsse:Username>
    <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wssusername-
    token-profile-1.0#PasswordText">adminOnDemand</wsse:Password>
    </wsse:UsernameToken>
    </wsse:Security>
    </soap:Header>
    To do this I tried clientuntcredentialprovider as suggested by most of the post online, but found of little help as the server complained of not be able to find the User Name and Password.
    To add to the mess problem I hit was I was not able to View the SOAP Request or Response sent by JDeveloper hence not helping me in debugging the same
    I have tried it on XML SPY by manually adding SOAP Header to the SOAP request and was able to find the response, but I have not been able to do the same using the JDeveloper 11g IDE.
    I have tried HTTP Analyzer assuming it might help, but unfortunately due to the huge size of WSDL, tool hanged my PC each time I loaded it.
    I know it should be fairly straight forward but just feel like missing something.
    Has anybody has got this thing working ?
    Regards,
    Deepak

    What exactly you mean that since your request is stateless you must send a Username token?
    Also, can you put here the code you used to populate the UNT.
    Finally, if possible, can you zip and email your wsdl, the http analyzer should be able to handle wsdls, even if they are huge.
    Thanks,
    Vishal

  • 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();
    }

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

  • 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

  • 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

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

Maybe you are looking for

  • I lost my iphone 4s please help

    i lost my iphone 4s between my sociology class and my house. The battery is dead its ios 7 and i dont have another apple product or itunes on my computer to use the find my phone app is there any way i can still find ???  please help!!! also if stole

  • Nokia lumia 620 data conection

    I have a problem with the Nokia Lumia 620. About 2 days data connection does not work. I put the sim card in another phone and my internet works. Until now the internet work's perfectly. What can I do? Solved! Go to Solution.

  • Can I automate the process of printing booklet?

    Can I automate the process of printing booklet? I use a saved Print Preset named "A5 booklet" I supply page range 1-16 then print as pdf using PDFCreater. File Name as 01.pdf, then pages 17-32 as 02.pdf and so on. I am aware that InDesign provides pr

  • What happened to my Synching Notes

    I can write notes on my iPhone and they used to show on my desktop in the mail program.  I've checked to have them synch but on my newly set up iMac 27 inch I don't see the notes and don't know where to find them. Any ideas?

  • Modest LAN set-up assistance for Airplay

    Hi, I wonder if anyone could suggest a decent set-up for a modest LAN. (I'm in the UK) I'm going to acquire ATV and a router and create a local wireless network so that an iPhone can be used to beam a live video signal for a particular situation. The