Attachments using JAX - RPC

I am using JAX - RPC for attachemnts using jwsdp-1.2. I am using DataHandler for attachments. I have been able to deploy the web service but when I try to connect to web service using client, I get following error. ny help will be greatly appreciated
serialization error: java.lang.NullPointerException
at com.sun.xml.rpc.encoding.AttachmentSerializer.serializeAsAttachment(AttachmentSerializer.java:120)
at com.sun.xml.rpc.encoding.AttachmentSerializer.serialize(AttachmentSerializer.java:74)
at com.sun.xml.rpc.encoding.ReferenceableSerializerImpl.serialize(ReferenceableSerializerImpl.java:71)
at attachments.client.AttachmentExampleAPI_sendDocument_RequestStruct_SOAPSerializer.doSerializeInstance(AttachmentExampleAPI_sendDocument_RequestStruct_SOAPSerializer.java:88)
and more lines of error.
Below is my client and webservice code :
CLIENT
FileDataSource fs = new FileDataSource("abc.txt");
DataHandler dhSource = new DataHandler(fs);
AttachmentExampleAPI up = new TestService_Impl().getAttachmentExampleAPIPort();
up.sendDocument("properties", dhSource));
WEBSERVICE CODE
public void sendDocument(String name, DataHandler dh) throws java.rmi.RemoteException {
DataSource ds = rdh.getDataSource();
dh.writeTo(new FileOutputStream("abc.txt" ));
Any help regarding the error will be great.

Not sure exactly what the problem is but i have sent attachements successfully from the server to client using:
SERVER method:
public javax.activation.DataHandler getAudioMIMEAttachment(java.lang.String in0, java.lang.String in1) throws java.rmi.RemoteException {
String inputFilename = null;
String inputFormat = null;               
inputFilename = "C:\\wav\\" + in0 + "." + in1;
System.out.println("You have requested the following file: " + inputFilename);
//create a new DataHandler object for the file contents
DataHandler dh = new DataHandler(new FileDataSource(new File(inputFilename)));
return dh;                    
Chunks from client code:
StreamingMultimediaSoapBindingStub stub = null;
try
stub = (StreamingMultimediaSoapBindingStub)(new StreamingDemoServiceLocator().getPort(StreamingMultimediaSoapBindingStub.class));
catch (javax.xml.rpc.ServiceException jre) {
System.err.println("Could not get client stub.");
jre.printStackTrace();
//call for binary DataHandler attachment
if(stub != null)
try
dh = stub.getAudioMIMEAttachment("long", "wav");                                   
catch (java.rmi.RemoteException re) {
System.err.println("Error whilst calling method on client stub.");
re.printStackTrace();                                   
Well, hope it helps
regards
Paul

Similar Messages

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

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

  • How to bind soap header using jax-rpc

    To Whom It May Concern:
    I am using Rad7, Ibm Websphere 6.1, on Windows XP.
    I created an SoapHeader first using a string and bind it using jax-ws.
    It works for jax-ws but unfortunately, my work services uses jax-rpc.
    Does anybody know how to bind the soap header using jax-rpc.
    Any help or hint would be greatly appreciated it.
    Here is my code:
    import org.apache.cxf.headers.Header;
    import org.apache.cxf.headers.Header.Direction;
    import org.apache.cxf.helpers.DOMUtils;
    import org.apache.cxf.binding.soap.SoapHeader;
    import javax.xml.namespace.QName;
    import java.io.StringReader;
    import java.util.List;
    import java.util.ArrayList;
    import javax.xml.ws.BindingProvider;
                   @Test
         public void testService() throws Exception {     
                   try
                        URL wsdlURL = new URL("http://localhost:9087/abc/services/ServiceABCService");
                        ServiceRequestServiceService service = new ServiceRequestServiceServiceLocator();
                        ServiceRequestService port = service.getServiceRequestService(wsdlURL);
                   //How to Add Soap Header using jax-ws
              String xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?><ABCHdrRq "
              + "xmlns=\"http://xmlns.ABCgc.net/ABC/2002/header/\" "
              + ">"
              + "<version>1.0</version><srcInfo><chType>abc</chType><chInst>0124</chInst>" +
                        "<appName>sSAR</appName><hostName>DW70210521</hostName><userId>fxue</userId>" +
                        "</srcInfo><startTimeStamp>2010-06-04T13:44:45.132</startTimeStamp><clientDt>2010-06-04T13:44:53.242</clientDt><serviceInfo><serviceName>ServiceRequestService</serviceName>" +
                        "<serviceFunc>addServiceRequest</serviceFunc></serviceInfo>" +
                   "<prevTransInfo><prevRqUID>BORS2010-06-04T13:41:10.2067f9368d1-8c5c</prevRqUID>" +     
                   "<prevRespTimestamp>2010-06-04T13:41:10.871</prevRespTimestamp>"+
                   "<prevRespEndTimestamp>2010-06-04T13:41:10.902</prevRespEndTimestamp>+</prevTransInfo>"+
                   "</ABCHdrRq>";
              SoapHeader dummyHeader1 = new SoapHeader(new QName("uri:http://xmlns.ABCgc.net/ABC/2002/header/", "ABCHdrRq"),
              DOMUtils.readXml(new StringReader(xml)).getDocumentElement());
              dummyHeader1.setDirection(Direction.DIRECTION_OUT);
              List<Header> headers = new ArrayList<Header>();
                   headers.add(dummyHeader1);
                   ((BindingProvider)port).getRequestContext().put(Header.HEADER_LIST, headers);
                   //How to Add Soap Header to the request using jax-ws
                   catch(Exception e)
                        System.out.println("Exception message:"+e.getMessage());
    Yours,
    Frustrated

    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.

  • XML Parser Error while creating Web service Client using JAX RPC

    hello evryone,
    Im facing XML Parser Error while creating web service client using JAX RPC. Im using Net Beans IDE for development purpose. I have wrote configuration file for client. Now i want to create Client stub. However i dont know how to do this in Net Beans. So i tried to do it from Command promt using command :
    wscompile -gen:client -d build -classpath build config-wsdl.xml
    here im getting Error:
    error parsing configuration file: XML parsing error: com.sun.xml.rpc.sp.ParseException:10: XML declaration may only begin entities
    Please help me out.
    Many thanks in advance,
    Kacee

    Can i use the client generated using jdeveloper 11g to import into the oracle forms 10g, i.e., form builder 10g. Currently this is the version we have in our office.

  • Using JAX-RPC handlers to proxy web service traffic

    Hi,
    I want to use JAX-RPC handlers to proxy web service traffic. In some instances the handler should modifiy / verify the message before forwarding the request to the remote web service end-point. Hence, the handler should forward the call by invoking the remote web service. In some cases the result from invoking the remove service should be post-processed by another proxy handler. To ensure that the result from invoking the remote service is available for post-processing I assume that the handler invoking the remote service must add the response message to the message context ( e g setProperty method) in the handler. Is this correctly understood?
    I would like to understand that this is a technically feasible and reasonable approach of using JAX-RPC. I'd really appreciate some feedback here.
    Many thanks,
    Tom

    Hi Eric,
    Thanks for your response. we are trying to access WSRR( manages end point urls for 7 different environments) and generate the end point dynamically at the design time. As we figured out WSRR is not compatible with OSB we are trying to implement these client side (OSB Proxy service) handlers which would get the dynamic endpoint depending on the environment used. I was able to create the handlers for this and set the jar in the classpath but the client service which should be using these handlers have to have these handlers defined in the deployment descriptor(web.xml) which am unable to see with a OSB project.
    Will there be a deployment descriptor(web.xml/webservices.xml) associated with Proxy services on OSB? Or Is there any other way to add custom JAX-RPC Handlers to a proxy service? Or is there any way to connect to WSRR directly?
    Thanks,
    Swetha

  • ClassCastException in my WS over JMS using JAX-RPC in WLS 10.3...

    Hi,
    I am developing a WS over JMS using JAX-RPC in WLS 10.3 (I tried both WLS 10.3.0 and 10.3.1). And when WLS is trying to marshal the response, it throws "ClassCastException":
    ava.lang.ClassCastException: org.tmforum.mtop.nrf.xsd.com.v1.EquipmentHolderEnumType cannot be cast to java.lang.String
    at com.bea.staxb.runtime.internal.StringTypeConverter.print(StringTypeConverter.java:45)
    at com.bea.staxb.runtime.internal.SimpleContentBeanMarshaller.print(SimpleContentBeanMarshaller.java:52)
    at com.bea.staxb.runtime.internal.RuntimeBindingProperty.getLexical(RuntimeBindingProperty.java:154)
    at com.bea.staxb.runtime.internal.PushMarshalResult.writeCharData(PushMarshalResult.java:639)
    at com.bea.staxb.runtime.internal.PushMarshalResult.visit(PushMarshalResult.java:413)
    at com.bea.staxb.runtime.internal.SimpleContentRuntimeBindingType.accept(SimpleContentRuntimeBindingType.java:46)
    at com.bea.staxb.runtime.internal.PushMarshalResult.writeContents(PushMarshalResult.java:195)
    at com.bea.staxb.runtime.internal.PushMarshalResult.marshalType(PushMarshalResult.java:153)
    at com.bea.staxb.runtime.internal.PushMarshalResult.visitProp(PushMarshalResult.java:631)
    at com.bea.staxb.runtime.internal.PushMarshalResult.visit(PushMarshalResult.java:403)
    at com.bea.staxb.runtime.internal.ByNameRuntimeBindingType.accept(ByNameRuntimeBindingType.java:89)
    at com.bea.staxb.runtime.internal.PushMarshalResult.writeContents(PushMarshalResult.java:195)
    at com.bea.staxb.runtime.internal.PushMarshalResult.marshalType(PushMarshalResult.java:153)
    at com.bea.staxb.runtime.internal.PushMarshalResult.visitProp(PushMarshalResult.java:631)
    at com.bea.staxb.runtime.internal.PushMarshalResult.visit(PushMarshalResult.java:403)
    at com.bea.staxb.runtime.internal.ByNameRuntimeBindingType.accept(ByNameRuntimeBindingType.java:89)
    at com.bea.staxb.runtime.internal.PushMarshalResult.writeContents(PushMarshalResult.java:195)
    at com.bea.staxb.runtime.internal.PushMarshalResult.marshalType(PushMarshalResult.java:153)
    at com.bea.staxb.runtime.internal.PushMarshalResult.visitProp(PushMarshalResult.java:631)
    at com.bea.staxb.runtime.internal.PushMarshalResult.visit(PushMarshalResult.java:400)
    at com.bea.staxb.runtime.internal.ByNameRuntimeBindingType.accept(ByNameRuntimeBindingType.java:89)
    at com.bea.staxb.runtime.internal.PushMarshalResult.writeContents(PushMarshalResult.java:195)
    at com.bea.staxb.runtime.internal.PushMarshalResult.marshalType(PushMarshalResult.java:153)
    at com.bea.staxb.runtime.internal.PushMarshalResult.visitProp(PushMarshalResult.java:631)
    at com.bea.staxb.runtime.internal.PushMarshalResult.visit(PushMarshalResult.java:403)
    at com.bea.staxb.runtime.internal.ByNameRuntimeBindingType.accept(ByNameRuntimeBindingType.java:89)
    at com.bea.staxb.runtime.internal.PushMarshalResult.writeContents(PushMarshalResult.java:195)
    at com.bea.staxb.runtime.internal.PushMarshalResult.marshalType(PushMarshalResult.java:153)
    at com.bea.staxb.runtime.internal.PushMarshalResult.visitProp(PushMarshalResult.java:631)
    at com.bea.staxb.runtime.internal.PushMarshalResult.visit(PushMarshalResult.java:400)
    at com.bea.staxb.runtime.internal.ByNameRuntimeBindingType.accept(ByNameRuntimeBindingType.java:89)
    at com.bea.staxb.runtime.internal.PushMarshalResult.writeContents(PushMarshalResult.java:195)
    at com.bea.staxb.runtime.internal.PushMarshalResult.marshalType(PushMarshalResult.java:153)
    at com.bea.staxb.runtime.internal.PushMarshalResult.visitProp(PushMarshalResult.java:631)
    at com.bea.staxb.runtime.internal.PushMarshalResult.visit(PushMarshalResult.java:403)
    at com.bea.staxb.runtime.internal.ByNameRuntimeBindingType.accept(ByNameRuntimeBindingType.java:89)
    at com.bea.staxb.runtime.internal.PushMarshalResult.writeContents(PushMarshalResult.java:195)
    at com.bea.staxb.runtime.internal.PushMarshalResult.marshalType(PushMarshalResult.java:153)
    at com.bea.staxb.runtime.internal.PushMarshalResult.visitProp(PushMarshalResult.java:631)
    at com.bea.staxb.runtime.internal.PushMarshalResult.visit(PushMarshalResult.java:400)
    at com.bea.staxb.runtime.internal.ByNameRuntimeBindingType.accept(ByNameRuntimeBindingType.java:89)
    at com.bea.staxb.runtime.internal.PushMarshalResult.writeContents(PushMarshalResult.java:195)
    at com.bea.staxb.runtime.internal.PushMarshalResult.marshalType(PushMarshalResult.java:153)
    at com.bea.staxb.runtime.internal.PushMarshalResult.visitProp(PushMarshalResult.java:631)
    at com.bea.staxb.runtime.internal.PushMarshalResult.visit(PushMarshalResult.java:403)
    at com.bea.staxb.runtime.internal.ByNameRuntimeBindingType.accept(ByNameRuntimeBindingType.java:89)
    at com.bea.staxb.runtime.internal.PushMarshalResult.writeContents(PushMarshalResult.java:195)
    at com.bea.staxb.runtime.internal.PushMarshalResult.marshalType(PushMarshalResult.java:153)
    at com.bea.staxb.runtime.internal.PushMarshalResult.visitProp(PushMarshalResult.java:631)
    at com.bea.staxb.runtime.internal.PushMarshalResult.visit(PushMarshalResult.java:403)
    at com.bea.staxb.runtime.internal.ByNameRuntimeBindingType.accept(ByNameRuntimeBindingType.java:89)
    at com.bea.staxb.runtime.internal.PushMarshalResult.writeContents(PushMarshalResult.java:195)
    at com.bea.staxb.runtime.internal.PushMarshalResult.marshalTopType(PushMarshalResult.java:96)
    at com.bea.staxb.runtime.internal.MarshallerImpl.marshalBindingType(MarshallerImpl.java:302)
    at com.bea.staxb.runtime.internal.MarshallerImpl.marshalElement(MarshallerImpl.java:383)
    at weblogic.wsee.bind.runtime.internal.LiteralSerializerContext.marshalElement(LiteralSerializerContext.java:82)
    at weblogic.wsee.bind.runtime.internal.BaseSerializerContext.internalSerializeElement(BaseSerializerContext.java:197)
    at weblogic.wsee.bind.runtime.internal.BaseSerializerContext.serializeElement(BaseSerializerContext.java:128)
    at weblogic.wsee.codec.soap11.SoapEncoder.encodePart(SoapEncoder.java:322)
    at weblogic.wsee.codec.soap11.SoapEncoder.encodeReturn(SoapEncoder.java:228)
    at weblogic.wsee.codec.soap11.SoapEncoder.encodeParts(SoapEncoder.java:215)
    at weblogic.wsee.codec.soap11.SoapEncoder.encode(SoapEncoder.java:134)
    at weblogic.wsee.codec.soap11.SoapCodec.encode(SoapCodec.java:134)
    at weblogic.wsee.ws.dispatch.server.CodecHandler.encode(CodecHandler.java:104)
    at weblogic.wsee.ws.dispatch.server.CodecHandler.handleResponse(CodecHandler.java:51)
    at weblogic.wsee.handler.HandlerIterator.handleResponse(HandlerIterator.java:287)
    at weblogic.wsee.handler.HandlerIterator.handleResponse(HandlerIterator.java:271)
    at weblogic.wsee.ws.dispatch.server.ServerDispatcher.callHandleResponse(ServerDispatcher.java:341)
    at weblogic.wsee.ws.dispatch.server.ServerDispatcher.dispatch(ServerDispatcher.java:189)
    at weblogic.wsee.ws.WsSkel.invoke(WsSkel.java:80)
    at weblogic.wsee.server.jms.JmsWebservicesMessageDispatcher.dispatchMessage(JmsWebservicesMessageDispatcher.java:175)
    at weblogic.wsee.server.jms.JmsQueueListener.processMessage(JmsQueueListener.java:397)
    at weblogic.wsee.server.jms.JmsQueueListener.onMessage(JmsQueueListener.java:392)
    at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:4585)
    at weblogic.jms.client.JMSSession.execute(JMSSession.java:4271)
    at weblogic.jms.client.JMSSession.executeMessage(JMSSession.java:3747)
    at weblogic.jms.client.JMSSession.access$000(JMSSession.java:114)
    at weblogic.jms.client.JMSSession$UseForRunnable.run(JMSSession.java:5096)
    at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    The "EquipmentHolderEnumType" is generated JAXB object (obviously it is not a String) from WSDL using WLS wsld generation. And here is how that Enum is defined in XSD:
    <xsd:simpleType name="EquipmentHolderEnumType">
    <xsd:annotation>
    <xsd:documentation>
    <p>Equipment holder type</p>
    </xsd:documentation>
    </xsd:annotation>
    <xsd:restriction base="xsd:string">
    <xsd:enumeration value="MINOR_EXT"/>
    <xsd:enumeration value="rack"/>
    <xsd:enumeration value="shelf"/>
    <xsd:enumeration value="sub_shelf"/>
    <xsd:enumeration value="slot"/>
    <xsd:enumeration value="sub_slot"/>
    <xsd:enumeration value="remote_unit"/>
    <xsd:enumeration value="remote_slots"/>
    </xsd:restriction>
    </xsd:simpleType>
    My question is why WLS is trying to cast the EnumType to String when marshalling it? How can I fix this exception?
    Also, second question: my WS will take some time to get the response ready (1+ minute). I was using WLS console test client to test my WS. And the test client always got time out:
    java.io.IOException: Request timed out
    at weblogic.wsee.connection.transport.jms.JmsTransport.receive(JmsTransport.java:356)
    at weblogic.testclient.WebServiceOperation.invokeJms(WebServiceOperation.java:463)
    at weblogic.testclient.WebServiceOperation.addWeblogicHeadersAndInvoke(WebServiceOperation.java:382)
    at weblogic.testclient.WebServiceOperation.invokeComplex(WebServiceOperation.java:305)
    at weblogic.testclient.WebServiceOperation.invoke(WebServiceOperation.java:626)
    How can I configure the WLS console test client so that I can increase teh timeout setting for the client?
    Thank you very much!
    Jian

    Hi, pls how did you solve your problem exatly? Because I have similar problem without solution.
    I have WSDL contract like:
    <xs:element name="duration">
    <xs:complexType>
    <xs:simpleContent>
    <xs:extension base="durationType">
    <xs:attribute name="days" type="xs:int" use="optional"/>
    </xs:extension>
    </xs:simpleContent>
    </xs:complexType>
    </xs:element>
    <xs:simpleType name="durationType">
    <xs:restriction base="xs:string">
    <xs:enumeration value="PERIODIC"/>
    <xs:enumeration value="PERPETUAL"/>
    <xs:enumeration value="CREDIT_DAYS"/>
    </xs:restriction>
    </xs:simpleType>
    And client site generated by WLS ant task "generate-from-wsdl" with "JAXRPC" option and when I use calling of this client and exeption was appeared:
    FaultString [com.company.DurationType] FaultActor [null] Detail [<detail><java:string>java.lang.ClassCastException: com.company.DurationType</java:string></detail>];
    Note: all other messages are correct.
    thx

  • Use JAX-RPC or SAAJ service?

    As far as I know we can set up web service with JAX-PRC or SAAJ.
    It seems that SAAJ is simpler than JAX-RPC for me, because it don't need to use WSDL.
    Is there any difference between them? How to choose between them?
    Please help!
    Thanks in advance!

    Hi,
    You should choose SAAJ in the case where the client has absolute knowledge of the SOAP messages that the web service receives and sends, and there is no reason for it to parse a WSDL in order to discover the web service's specification.
    You should choose JAX-RPC in the case where the client knows nothing about the web service at runtime, and it needs to dynamically construct the call to it.
    As far as complexity is concerned, i believe that JAX-RPC is much simpler than SAAJ, because it gives the programmer a simple API that wraps everything concerning the SOAP messages and their complexity. The programmer does not have to manually construct or parse the SOAP message. Instead, he just makes a rpc with the appropriate parameter values.
    I hope i helped
    Regards

  • How to go from a .wsdl to .war file to deploy on Tomcat ? (using jax-rpc?)

    I have created a .wsdl file using XMLSpy and I want to deploy the service on tomcat. I have been unsuccessful in using the "wscompile -import" option.
    Does anyone know how to cross-compile a .wsdl file into a .war so it can be deployed on tomcat? If there is another way other than a .war file, that is fine too...
    Currently, I am using WSDL2Java tool by Apache Axis. I take my .wsdl file use the WSDL2Java tool to get the java files, Then I run the java files through wscompile, wsdeploy etc.... the problem with this approach is that the .wsdl file produced by the wsdeploy does not support the document encoding (everything switched to rpc) and no literal either (I think).
    If anyone has figured out a better way of going from .wsdl to java or .war or tomcat.. please let me know.. I'm running out of options...
    Thank you !

    The link worked correctly for me. You can also refer to a recently published whitepaper at
    https://jax-rpc.dev.java.net/whitepaper/1.1/index-part1.html. Scenario 5 in second part (https://jax-rpc.dev.java.net/whitepaper/1.1/index-part2.html#Scenario5) of the whitepaper describes how to achieve your scenario.
    Post your JAX-RPC related questions to [email protected] for a quicker resolution.
    Send an email to [email protected] to subscribe to the alias.
    Send an mail to [email protected] for a complete list of help commands.
    Thanks for your interest in JAX-RPC.
    Regards,
    -Arun

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

  • Unable to call the service using JAX-RPC

    Hi,
    I created a web service in Weblogic6.1 using the ant wsgen utility.
    When i tried to invoke the service using my client program, i get the following error.
    Exception in thread "main" modeler error: model error: invalid entity name: "string" (in namespace: "http://www.w3.org/1999/XMLSchema"
    at com.sun.xml.rpc.processor.modeler.wsdl.WSDLModeler.buildModel(WSDLModeler.java:137)
    at com.sun.xml.rpc.processor.config.ModelInfo.buildModel(ModelInfo.java:77)
    at com.sun.xml.rpc.client.dii.ServiceInfoBuilder.getModel(ServiceInfoBuilder.java:96)
    at com.sun.xml.rpc.client.dii.ServiceInfoBuilder.buildServiceInfo(ServiceInfoBuilder.java:59)
    at com.sun.xml.rpc.client.dii.ConfiguredService.<init>(ConfiguredService.java:44)
    at com.sun.xml.rpc.client.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:32)
    at JAXRPCClient.main(JAXRPCClient.java:20)
    CAUSE:
    model error: invalid entity name: "string" (in namespace: "http://www.w3.org/1999/XMLSchema")
    at com.sun.xml.rpc.processor.schema.InternalSchemaBuilder.buildTypeDefinition(InternalSchemaBuilder.java:61)
    at com.sun.xml.rpc.processor.schema.InternalSchema.findTypeDefinition(InternalSchema.java:45)
    at com.sun.xml.rpc.processor.modeler.wsdl.SchemaAnalyzer.schemaTypeToSOAPType(SchemaAnalyzer.java:66)
    at com.sun.xml.rpc.processor.modeler.wsdl.WSDLModeler.processSOAPOperationRPCStyle(WSDLModeler.java:592)
    at com.sun.xml.rpc.processor.modeler.wsdl.WSDLModeler.processSOAPOperation(WSDLModeler.java:423)
    at com.sun.xml.rpc.processor.modeler.wsdl.WSDLModeler.processPort(WSDLModeler.java:344)
    at com.sun.xml.rpc.processor.modeler.wsdl.WSDLModeler.processService(WSDLModeler.java:231)
    at com.sun.xml.rpc.processor.modeler.wsdl.WSDLModeler.internalBuildModel(WSDLModeler.java:196)
    at com.sun.xml.rpc.processor.modeler.wsdl.WSDLModeler.buildModel(WSDLModeler.java:103)
    at com.sun.xml.rpc.processor.config.ModelInfo.buildModel(ModelInfo.java:77)
    at com.sun.xml.rpc.client.dii.ServiceInfoBuilder.getModel(ServiceInfoBuilder.java:96)
    at com.sun.xml.rpc.client.dii.ServiceInfoBuilder.buildServiceInfo(ServiceInfoBuilder.java:59)
    at com.sun.xml.rpc.client.dii.ConfiguredService.<init>(ConfiguredService.java:44)
    at com.sun.xml.rpc.client.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:32)
    at JAXRPCClient.main(JAXRPCClient.java:20)
    CAUSE:
    invalid entity name: "string" (in namespace: "http://www.w3.org/1999/XMLSchema")
    at com.sun.xml.rpc.wsdl.framework.AbstractDocument.find(AbstractDocument.java:110)
    at com.sun.xml.rpc.processor.schema.InternalSchemaBuilder.buildTypeDefinition(InternalSchemaBuilder.java:54)
    at com.sun.xml.rpc.processor.schema.InternalSchema.findTypeDefinition(InternalSchema.java:45)
    at com.sun.xml.rpc.processor.modeler.wsdl.SchemaAnalyzer.schemaTypeToSOAPType(SchemaAnalyzer.java:66)
    at com.sun.xml.rpc.processor.modeler.wsdl.WSDLModeler.processSOAPOperationRPCStyle(WSDLModeler.java:592)
    at com.sun.xml.rpc.processor.modeler.wsdl.WSDLModeler.processSOAPOperation(WSDLModeler.java:423)
    at com.sun.xml.rpc.processor.modeler.wsdl.WSDLModeler.processPort(WSDLModeler.java:344)
    at com.sun.xml.rpc.processor.modeler.wsdl.WSDLModeler.processService(WSDLModeler.java:231)
    at com.sun.xml.rpc.processor.modeler.wsdl.WSDLModeler.internalBuildModel(WSDLModeler.java:196)
    at com.sun.xml.rpc.processor.modeler.wsdl.WSDLModeler.buildModel(WSDLModeler.java:103)
    at com.sun.xml.rpc.processor.config.ModelInfo.buildModel(ModelInfo.java:77)
    at com.sun.xml.rpc.client.dii.ServiceInfoBuilder.getModel(ServiceInfoBuilder.java:96)
    at com.sun.xml.rpc.client.dii.ServiceInfoBuilder.buildServiceInfo(ServiceInfoBuilder.java:59)
    at com.sun.xml.rpc.client.dii.ConfiguredService.<init>(ConfiguredService.java:44)
    at com.sun.xml.rpc.client.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:32)
    at JAXRPCClient.main(JAXRPCClient.java:20)
    My wsdl file is
    - <definitions targetNamespace="java:com.mountain.molehill.ejb.controller" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:tns="java:com.mountain.molehill.ejb.controller" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
    - <types>
    <schema targetNamespace="java:com.mountain.molehill.ejb.controller" xmlns="http://www.w3.org/1999/XMLSchema" />
    </types>
    - <message name="getPointBalanceRequest">
    <part name="arg0" type="xsd:string" />
    </message>
    - <message name="getPointBalanceResponse">
    <part name="return" type="xsd:string" />
    </message>
    - <portType name="WSManagerPortType">
    - <operation name="getPointBalance">
    <input message="tns:getPointBalanceRequest" />
    <output message="tns:getPointBalanceResponse" />
    </operation>
    </portType>
    - <binding name="WSManagerBinding" type="tns:WSManagerPortType">
    <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
    - <operation name="getPointBalance">
    <soap:operation soapAction="urn:getPointBalance" />
    - <input>
    <soap:body use="encoded" namespace="urn:WSManager" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
    </input>
    - <output>
    <soap:body use="encoded" namespace="urn:WSManager" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
    </output>
    </operation>
    </binding>
    - <service name="WSManager">
    <documentation>todo</documentation>
    - <port name="WSManagerPort" binding="tns:WSManagerBinding">
    <soap:address location="http://blrkec17805:7001/WS/rpc_URI" />
    </port>
    </service>
    </definitions>
    Could anybody help me in resolving this problem?
    Thanks in advance,
    Rajadurai

    Hello,
    edit the wsdl file and change 'http://www.w3.org/1999/XMLSchema' to 'http://www.w3.org/2001/XMLSchema' for both xmlns:xsd and xmlns then try again.
    Andre

  • 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

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

  • Get login name JAX-RPC

    Hello
    I am using Java EE 5 and Glassfish.
    Currently I am developing an application using JAX-RPC (1.4 style). This is NOT JAX-WS or older tech where everything had to be done "by hand". its something of a halfbreed invented at the time.
    I have a service that looks something like the example, although much more complicated :)
    package samples.webservices.jaxrpc.simple;
    public class HelloImpl implements HelloIF {
        public String message = "Hello ";
        public String sayHello(String s) {
            return message + s;
    }The IF class interface extends Remote
    I would like to get the currently authenticated users user name for the specific RPC call. In older versions it was simple because you needed to deal with the SOAP envelope anyway and in JAX-WS it seems equally simple. but in the version I am using it seems straight out impossible to get the MessageContext or similar.
    Can anyone please help me? I have read an awful lot of web pages without finding the answer.
    Thanks in advance
    / Stefan

    Ok after much reading, thinking and testing I was able to solve the problem (not very pretty but hopefully working).
    Create an extra soap handler old school way
    public class MySOAPHandler extends GenericHandler {
       public boolean handleRequest(MessageContext context) {
               Object o = context.getProperty("com.sun.xml.rpc.server.http.HttpServletRequest");
                if ( o != null ) {
                     currentuser = ((HttpServletRequest)o).getRemoteUser();
    }Then register this in webservicese.xml
           <handler>
               <handler-name>My SOAP Handler</handler-name>
               <handler-class>full.class.path.MySOAPHandler</handler-class>
          </handler>      Hope this helps someone else out there :)

Maybe you are looking for

  • How do I print more copies, grayscale, or on special media with The Lorax Daily Print Activities?

    If you want to print multiple copies of an item, or choose a different paper type or print setup (like black and white printing), do the following: Load the printer with your media and make sure the printer is on, Open The Lorax Daily Print Activitie

  • Link to a document

    Dear All- can anyone help me? I am using Captivate and uploading the content to a SCORM 1.2 LMS. I have a button in my Captivate file which on success (should) open a new window containing a evaluation word document. I have uploaded the document to a

  • JAXP seems to be stripping off DOCTYPE tag

    When I parse a document, the DOCTYPE tag is getting stripped off. To parse, I read the document from file and it looks like : <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j="

  • Syncing Ring Tones & 12 days of Christmas

    Help Help Help, I downloaded various items from the 12 days of christmas and also bought a ring tone from Itunes. All was fine until I connected the phone to the pc to get some photos from it. Once I went back in the ringtone had gone along with all

  • Can Aperture embed a copyright icon, batch mode?

    I'm on a 30 day trial of Aperture 2. I want to post images on the web, from the Aug. 1 solar eclipse: http://www.caltechscience.com/08solareclipse/index.html I typically manually put in "©2008 Bob Yen" in the lower-right corner, to dissuade copyright