Hi!

I’m using apache-cxf-2.6.1 and JDK 1.6 and I have one error using the
Client web service autogenerated by apache cfx

I have generated the code with wsdl2java
C:\>.\apache-cxf-2.6.1\bin\wsdl2java.bat -wsdlLocation "" -frontend jaxws21
-client myservice.wsdl

Several files are created, also

myServiceSEI_myServicePort_Client with a main() method

Pasing the wsdl as parameter to the main method I obtain the following
stacktrace at this line.

javax.activation.DataHandler _getPDF__return = port.getPDF(_getPDF_docName);

Exception in thread "main"
com.sun.xml.internal.ws.streaming.XMLStreamReaderException: unexpected XML
tag. expected: {http://myservice/test}getPDFResponse but found: {
http://myservice/test}getPDF
    at
com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil.verifyTag(XMLStreamReaderUtil.java:201)
    at
com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil.verifyTag(XMLStreamReaderUtil.java:209)
    at
com.sun.xml.internal.ws.client.sei.ResponseBuilder$DocLit.readResponse(ResponseBuilder.java:511)
    at
com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:254)
    at
com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:222)
    at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:115)
    at $Proxy32.getPDF(Unknown Source)
    at
com.test.myServiceSEI_myServicePort_Client.main(myServiceSEI_myServicePort_Client.java:59)

The service code is...

   @WebResult(name = "return", targetNamespace = "")
   @Action(input = "http://myservice/myServiceSEI/getPDFRequest";, output = "
http://myservice/myServiceSEI/getPDFResponse"})
    @RequestWrapper(localName = "getPDF", targetNamespace = "
http://myservice/test";, className = "com.test.GetPDF")
    @WebMethod
    @ResponseWrapper(localName = "getPDFResponse", targetNamespace = "{
http://myservice/test";, className = "com.test.GetPDFResponse")
    public javax.activation.DataHandler getPDF(
        @WebParam(name = "docName", targetNamespace = "")
        java.lang.String docName,
        @WebParam(name = "docSequenceNumber", targetNamespace = "")
        java.lang.String docSequenceNumber
    );

It's just the auto-generated code, I'm not changing anything (not yet)

Any idea about the error?

Un saludo
Carlos Garcés

Reply via email to