Axis2
  1. Axis2
  2. AXIS2-2353

Selecting a port name / wsdl provided scenario

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: jaxws
    • Labels:
      None

      Description

      Port Name confusion.

      EndpointDesciptionImpl#selectWSDLPortToUse (Line 1396) says:

      // Per JSR-181,
      // - The portType name corresponds to the WebService.name annotation value, which is
      // returned by getName()
      // - The portType namespace corresponds to the WebService.targetNamespace annotation, which
      // is returned by getTargetNamespace()
      String portTypeLP = getName();

      BUT, EndpointDesciptionImpl#getAnnoWebServicePortName does this:

      // This is the @WebService annotation path
      // Default value is the @WebService.name of the class or interface + "Port"
      // Per JSR-181 MR Sec 4.1, pg 15
      annotation_PortName = getAnnoWebServiceName() + "Port";

      So which is correct?

      Here's the scenario we are trying:
      http://cwiki.apache.org/GMOxDOC20/simple-web-service-with-jax-ws.html

      We will upload the latest versions of wsdl/service/client as well.

      – dims

      1. CalculatorService.java
        2 kB
        Lin Sun
      2. CalculatorClient.java
        2 kB
        Lin Sun
      3. CalculatorService.wsdl
        3 kB
        Lin Sun
      4. Calculator.java
        2 kB
        Lin Sun
      5. Calculator.java
        2 kB
        Lin Sun

        Activity

        Hide
        Davanum Srinivas added a comment -

        Rich,

        Could u please chime in?

        thanks,
        dims

        Show
        Davanum Srinivas added a comment - Rich, Could u please chime in? thanks, dims
        Hide
        Lin Sun added a comment -

        Hi,

        I tried to replace

        String portTypeLP = getName();

        with

        String portTypeLP = getAnnoWebServicePortName();

        and was able to pass this.

        Then I ran into the following error on the client:

        Exception in thread "main" javax.xml.ws.WebServiceException: org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character 'o' (code 111) in prolog; expected '<'
        at [row,col

        {unknown-source}]: [1,1]
        at org.apache.axis2.jaxws.ExceptionFactory.createWebServiceException(ExceptionFactory.java:179)
        at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:79)
        at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:133)
        at org.apache.axis2.jaxws.core.controller.AxisInvocationController.execute(AxisInvocationController.java:552)
        at org.apache.axis2.jaxws.core.controller.AxisInvocationController.doInvoke(AxisInvocationController.java:110)
        at org.apache.axis2.jaxws.core.controller.InvocationController.invoke(InvocationController.java:97)
        at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invokeSEIMethod(JAXWSProxyHandler.java:265)
        at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invoke(JAXWSProxyHandler.java:142)
        at $Proxy9.add(Unknown Source)
        at org.apache.geronimo.samples.jws.client.CalculatorClient.add(CalculatorClient.java:46)
        at org.apache.geronimo.samples.jws.client.CalculatorClient.main(CalculatorClient.java:33)
        Caused by: org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character 'o' (code 111) in prolog; expected '<'
        at [row,col {unknown-source}

        ]: [1,1]
        at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:212)
        at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(StAXSOAPModelBuilder.java:165)
        at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:113)
        at org.apache.axis2.builder.BuilderUtil.getSOAPBuilder(BuilderUtil.java:474)
        at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:130)
        at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:77)
        at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:357)
        at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:295)
        at org.apache.axis2.jaxws.core.controller.AxisInvocationController.execute(AxisInvocationController.java:547)
        ... 7 more
        Caused by: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character 'o' (code 111) in prolog; expected '<'
        at [row,col

        {unknown-source}

        ]: [1,1]
        at com.ctc.wstx.sr.StreamScanner.throwUnexpectedChar(StreamScanner.java:623)
        at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2047)
        at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069)
        at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:126)
        ... 15 more

        Attaching the files in a min.

        Show
        Lin Sun added a comment - Hi, I tried to replace String portTypeLP = getName(); with String portTypeLP = getAnnoWebServicePortName(); and was able to pass this. Then I ran into the following error on the client: Exception in thread "main" javax.xml.ws.WebServiceException: org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character 'o' (code 111) in prolog; expected '<' at [row,col {unknown-source}]: [1,1] at org.apache.axis2.jaxws.ExceptionFactory.createWebServiceException(ExceptionFactory.java:179) at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:79) at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:133) at org.apache.axis2.jaxws.core.controller.AxisInvocationController.execute(AxisInvocationController.java:552) at org.apache.axis2.jaxws.core.controller.AxisInvocationController.doInvoke(AxisInvocationController.java:110) at org.apache.axis2.jaxws.core.controller.InvocationController.invoke(InvocationController.java:97) at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invokeSEIMethod(JAXWSProxyHandler.java:265) at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invoke(JAXWSProxyHandler.java:142) at $Proxy9.add(Unknown Source) at org.apache.geronimo.samples.jws.client.CalculatorClient.add(CalculatorClient.java:46) at org.apache.geronimo.samples.jws.client.CalculatorClient.main(CalculatorClient.java:33) Caused by: org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character 'o' (code 111) in prolog; expected '<' at [row,col {unknown-source} ]: [1,1] at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:212) at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(StAXSOAPModelBuilder.java:165) at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:113) at org.apache.axis2.builder.BuilderUtil.getSOAPBuilder(BuilderUtil.java:474) at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:130) at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:77) at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:357) at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:295) at org.apache.axis2.jaxws.core.controller.AxisInvocationController.execute(AxisInvocationController.java:547) ... 7 more Caused by: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character 'o' (code 111) in prolog; expected '<' at [row,col {unknown-source} ]: [1,1] at com.ctc.wstx.sr.StreamScanner.throwUnexpectedChar(StreamScanner.java:623) at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2047) at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069) at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:126) ... 15 more Attaching the files in a min.
        Hide
        Jeff Barrett added a comment -

        Looking into this now...,

        Show
        Jeff Barrett added a comment - Looking into this now...,
        Hide
        Jeff Barrett added a comment -

        Regarding Dim's question above...
        EndpointDesciptionImpl#selectWSDLPortToUse (Line 1396) says:

        // Per JSR-181,
        // - The portType name corresponds to the WebService.name annotation value, which is
        // returned by getName()
        // - The portType namespace corresponds to the WebService.targetNamespace annotation, which
        // is returned by getTargetNamespace()
        String portTypeLP = getName();

        BUT, EndpointDesciptionImpl#getAnnoWebServicePortName does this:

        // This is the @WebService annotation path
        // Default value is the @WebService.name of the class or interface + "Port"
        // Per JSR-181 MR Sec 4.1, pg 15
        annotation_PortName = getAnnoWebServiceName() + "Port";

        So which is correct?

        Maybe I'm not understanding the issue yet, but they are both correct
        because they are doing different things. The first snippet is working
        with wsdl:portType and the second with wsdl:port.

        From JSR-181 section 4.1 "Annotation: javax.jws.WebService" section 4.1.1 says that WebService attributes:

        • "name" maps to "wsdl:portType"
        • "portName" maps to "wsdl:port"

        Give that, the methods on EnpointDescription (and yes, I'll update the javadocs!) do the following

        • getName() essentially returns WebService.name and thus "wsdl:portType". This is via delegation to
          getAnnoWebServiceName()
        • getPortQName() essentially returns WebService.portName and thus "wsdl:port" (not portType). This is
          via delegation to getAnnoWebServicePortName() along with some tns processing to return a QName.

        The code snippet from selectWSDLPortsToUse intends to gets the portType, then finds all the ports that use
        that portType, and then get the first one of those that has a SOAP address.

        Regarding Lin's comment above ...
        I tried to replace

        String portTypeLP = getName();

        with

        String portTypeLP = getAnnoWebServicePortName();

        and was able to pass this.

        I don't think that was a valid change (give the above explanation). I'll look at the
        attached WSDL and Java and see why that change was necessary to locate a port in the WSDL.

        More information soon ...

        Show
        Jeff Barrett added a comment - Regarding Dim's question above... EndpointDesciptionImpl#selectWSDLPortToUse (Line 1396) says: // Per JSR-181, // - The portType name corresponds to the WebService.name annotation value, which is // returned by getName() // - The portType namespace corresponds to the WebService.targetNamespace annotation, which // is returned by getTargetNamespace() String portTypeLP = getName(); BUT, EndpointDesciptionImpl#getAnnoWebServicePortName does this: // This is the @WebService annotation path // Default value is the @WebService.name of the class or interface + "Port" // Per JSR-181 MR Sec 4.1, pg 15 annotation_PortName = getAnnoWebServiceName() + "Port"; So which is correct? Maybe I'm not understanding the issue yet, but they are both correct because they are doing different things. The first snippet is working with wsdl:portType and the second with wsdl:port. From JSR-181 section 4.1 "Annotation: javax.jws.WebService" section 4.1.1 says that WebService attributes: "name" maps to "wsdl:portType" "portName" maps to "wsdl:port" Give that, the methods on EnpointDescription (and yes, I'll update the javadocs!) do the following getName() essentially returns WebService.name and thus "wsdl:portType". This is via delegation to getAnnoWebServiceName() getPortQName() essentially returns WebService.portName and thus "wsdl:port" (not portType). This is via delegation to getAnnoWebServicePortName() along with some tns processing to return a QName. The code snippet from selectWSDLPortsToUse intends to gets the portType, then finds all the ports that use that portType, and then get the first one of those that has a SOAP address. Regarding Lin's comment above ... I tried to replace String portTypeLP = getName(); with String portTypeLP = getAnnoWebServicePortName(); and was able to pass this. I don't think that was a valid change (give the above explanation). I'll look at the attached WSDL and Java and see why that change was necessary to locate a port in the WSDL. More information soon ...
        Hide
        Jeff Barrett added a comment -

        Hi All,

        I've looked at the WSDL and the client java attached to this Jira and at
        the SEI from the link above
        http://cwiki.apache.org/GMOxDOC20/simple-web-service-with-jax-ws.html

        It looks to me like the WSDL and the annotations on the SEI don't match
        up, and that is why no ports are being found. In other words, I think
        this is a problem with the Calculator WSDL and/or SEI class. (I'm not
        sure why Lin's change made a difference, but I didn't explore that
        thouroughly since I don't believe it is a correct change.)

        Specifically, the WSDL indicates that the portType is
        "CalculatorPortType", however the SEI (via JSR-181 annotation defaulting)
        indicates the portType is "Calculator". So, when we use the annotation
        value of "Calculator" for the portType to find a port in the WSDL, none is
        found since the port in the WSDL specifies a portType of
        "CalculatorPortType".

        WSDL SNIPPET
        ============
        Excerpt from the attached WSDL file. The (only) port in the WSDL
        references a wsdl:portType of "CalculatorPortType"

        <wsdl:portType name="CalculatorPortType">
        (1) The WSDL Port Type
        <wsdl:operation name="add">
        <wsdl:input name="add" message="tns:add"/>
        <wsdl:output name="addResponse" message="tns:addResponse"/>
        </wsdl:operation>
        </wsdl:portType>

        <wsdl:binding name="CalculatorSoapBinding" type="tns:CalculatorPortType">
        (2) Referenced from this binding
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>

        <wsdl:operation name="add">
        <soap:operation soapAction="add" style="document"/>
        <wsdl:input name="add">
        <soap:body use="literal"/>
        </wsdl:input>
        <wsdl:output name="addResponse">
        <soap:body use="literal"/>
        </wsdl:output>
        </wsdl:operation>

        </wsdl:binding>

        <wsdl:service name="Calculator">
        <wsdl:port name="CalculatorPort" binding="tns:CalculatorSoapBinding">
        (3) Which is referenced from this port
        <soap:address location="http://localhost:8080/jaxws-calculator-1.0/calculator"/>
        <wswa:UsingAddressing xmlns:wswa="http://www.w3.org/2005/08/addressing/wsdl"/>
        </wsdl:port>
        </wsdl:service>

        SEI SNIPPET
        ===========
        Excerpt from Calculator.java from
        http://cwiki.apache.org/GMOxDOC20/simple-web-service-with-jax-ws.html

        @WebService
        public interface Calculator

        { @WebMethod public int add(@WebParam(name = "value1") int value1, @WebParam(name = "value2") int value2); }

        (1) Notice that the @WebService annotation has no attributes specified, so
        the values will be defaulted. So, for portType which maps to
        WebService.name, the default value will be "Calculator". This is per
        JSR-181 section 4.1 "Annotation: javax.jws.WebService" section 4.1.1:

        • "name" Used as the name of the wsdl:portType. Default value is "Simple
          name of the Java class or interface".

        TESTCASE THAT VALIDATES DEFAULT PORT SELECTION
        ==============================================
        there is a test for the default port selection in the JAXWS test bucket:
        /axis2-apache/modules/jaxws/test/org/apache/axis2/jaxws/description/PortSelectionTests.java

        Show
        Jeff Barrett added a comment - Hi All, I've looked at the WSDL and the client java attached to this Jira and at the SEI from the link above http://cwiki.apache.org/GMOxDOC20/simple-web-service-with-jax-ws.html It looks to me like the WSDL and the annotations on the SEI don't match up, and that is why no ports are being found. In other words, I think this is a problem with the Calculator WSDL and/or SEI class. (I'm not sure why Lin's change made a difference, but I didn't explore that thouroughly since I don't believe it is a correct change.) Specifically, the WSDL indicates that the portType is "CalculatorPortType", however the SEI (via JSR-181 annotation defaulting) indicates the portType is "Calculator". So, when we use the annotation value of "Calculator" for the portType to find a port in the WSDL, none is found since the port in the WSDL specifies a portType of "CalculatorPortType". WSDL SNIPPET ============ Excerpt from the attached WSDL file. The (only) port in the WSDL references a wsdl:portType of "CalculatorPortType" <wsdl:portType name="CalculatorPortType"> (1) The WSDL Port Type <wsdl:operation name="add"> <wsdl:input name="add" message="tns:add"/> <wsdl:output name="addResponse" message="tns:addResponse"/> </wsdl:operation> </wsdl:portType> <wsdl:binding name="CalculatorSoapBinding" type="tns:CalculatorPortType"> (2) Referenced from this binding <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> <wsdl:operation name="add"> <soap:operation soapAction="add" style="document"/> <wsdl:input name="add"> <soap:body use="literal"/> </wsdl:input> <wsdl:output name="addResponse"> <soap:body use="literal"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="Calculator"> <wsdl:port name="CalculatorPort" binding="tns:CalculatorSoapBinding"> (3) Which is referenced from this port <soap:address location="http://localhost:8080/jaxws-calculator-1.0/calculator"/> <wswa:UsingAddressing xmlns:wswa="http://www.w3.org/2005/08/addressing/wsdl"/> </wsdl:port> </wsdl:service> SEI SNIPPET =========== Excerpt from Calculator.java from http://cwiki.apache.org/GMOxDOC20/simple-web-service-with-jax-ws.html @WebService public interface Calculator { @WebMethod public int add(@WebParam(name = "value1") int value1, @WebParam(name = "value2") int value2); } (1) Notice that the @WebService annotation has no attributes specified, so the values will be defaulted. So, for portType which maps to WebService.name, the default value will be "Calculator". This is per JSR-181 section 4.1 "Annotation: javax.jws.WebService" section 4.1.1: "name" Used as the name of the wsdl:portType. Default value is "Simple name of the Java class or interface". TESTCASE THAT VALIDATES DEFAULT PORT SELECTION ============================================== there is a test for the default port selection in the JAXWS test bucket: /axis2-apache/modules/jaxws/test/org/apache/axis2/jaxws/description/PortSelectionTests.java
        Hide
        Lin Sun added a comment -

        Hi Jeff,

        Thanks for your comment. We discovered the inconsistency between the wsdl and SEI file just before we wrote this bug, so we modified the SEI a bit to below:

        @WebService(name="Calculator", portName="CalculatorPortType", targetNamespace = "http://jws.samples.geronimo.apache.org")
        public interface Calculator {

        I'll attach the SEI file in a minute. Sorry we should have attached it in the first place and the wiki is outdated. If you need any other files, just let me know.

        Lin

        Show
        Lin Sun added a comment - Hi Jeff, Thanks for your comment. We discovered the inconsistency between the wsdl and SEI file just before we wrote this bug, so we modified the SEI a bit to below: @WebService(name="Calculator", portName="CalculatorPortType", targetNamespace = "http://jws.samples.geronimo.apache.org") public interface Calculator { I'll attach the SEI file in a minute. Sorry we should have attached it in the first place and the wiki is outdated. If you need any other files, just let me know. Lin
        Hide
        Jeff Barrett added a comment -

        Hi Lin,

        That attached SEI and WSDL still don't match each other.

        Given the SEI annotation:
        @WebService(name="Calculator", portName="CalculatorPortType", targetNamespace = "http://jws.samples.geronimo.apache.org")
        public interface Calculator {

        The annotation attribute "name" which indicates the WSDL PortType has a
        value of "Calculator".

        Give th WSDL definition:
        <wsdl:portType name="CalculatorPortType">

        The only PortType in the WSDL is named "CalculatorPortType".

        You need to change EITHER the SEI annotation OR the WSDL. It is probably
        easier to change the SEI annotation, so here's what the new SEI annotation
        would probably look like. Notice I changed the attribute values for name
        and portName:

        @WebService(name="CalculatorPortType", portName="CalculatorPort", targetNamespace = "http://jws.samples.geronimo.apache.org")
        public interface Calculator {

        I hope that helps.

        Show
        Jeff Barrett added a comment - Hi Lin, That attached SEI and WSDL still don't match each other. Given the SEI annotation: @WebService(name="Calculator", portName="CalculatorPortType", targetNamespace = "http://jws.samples.geronimo.apache.org") public interface Calculator { The annotation attribute "name" which indicates the WSDL PortType has a value of "Calculator". Give th WSDL definition: <wsdl:portType name="CalculatorPortType"> The only PortType in the WSDL is named "CalculatorPortType". You need to change EITHER the SEI annotation OR the WSDL. It is probably easier to change the SEI annotation, so here's what the new SEI annotation would probably look like. Notice I changed the attribute values for name and portName: @WebService(name="CalculatorPortType", portName="CalculatorPort", targetNamespace = "http://jws.samples.geronimo.apache.org") public interface Calculator { I hope that helps.
        Hide
        Jeff Barrett added a comment -

        I think the problem is in the mismatch between the SEI and the WSDL per my comment above. If that's not the problem, please reopen this issue.

        Show
        Jeff Barrett added a comment - I think the problem is in the mismatch between the SEI and the WSDL per my comment above. If that's not the problem, please reopen this issue.
        Hide
        Lin Sun added a comment -

        Updated the SEI per Jeff's comment.

        However, I still got similar exception on the client side -

        Exception in thread "main" javax.xml.ws.WebServiceException: org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character 'o' (code 111) in prolog; expected '<'
        at [row,col

        {unknown-source}]: [1,1]
        at org.apache.axis2.jaxws.ExceptionFactory.createWebServiceException(ExceptionFactory.java:172)
        at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:67)
        at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:125)
        at org.apache.axis2.jaxws.core.controller.AxisInvocationController.execute(AxisInvocationController.java:572)
        at org.apache.axis2.jaxws.core.controller.AxisInvocationController.doInvoke(AxisInvocationController.java:109)
        at org.apache.axis2.jaxws.core.controller.InvocationController.invoke(InvocationController.java:96)
        at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invokeSEIMethod(JAXWSProxyHandler.java:264)
        at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invoke(JAXWSProxyHandler.java:136)
        at $Proxy9.add(Unknown Source)
        at org.apache.geronimo.samples.jws.client.CalculatorClient.add(CalculatorClient.java:45)
        at org.apache.geronimo.samples.jws.client.CalculatorClient.main(CalculatorClient.java:33)
        Caused by: org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character 'o' (code 111) in prolog; expected '<'
        at [row,col {unknown-source}

        ]: [1,1]
        at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:211)
        at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(StAXSOAPModelBuilder.java:163)
        at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:111)
        at org.apache.axis2.builder.BuilderUtil.getSOAPBuilder(BuilderUtil.java:474)
        at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:130)
        at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:77)
        at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:356)
        at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:294)
        at org.apache.axis2.jaxws.core.controller.AxisInvocationController.execute(AxisInvocationController.java:567)
        ... 7 more
        Caused by: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character 'o' (code 111) in prolog; expected '<'
        at [row,col

        {unknown-source}

        ]: [1,1]
        at com.ctc.wstx.sr.StreamScanner.throwUnexpectedChar(StreamScanner.java:623)
        at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2047)
        at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069)
        at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:125)
        ... 15 more

        On my server side, I got -

        14:45:57,515 ERROR [Axis2WebServiceContainer] Exception occurred while trying to
        invoke service method doService()
        org.apache.axis2.AxisFault: A Java method was not found for the operation. If th
        e WSDL operation name is different from the Java method name, make sure that the
        @WebMethod annotation name is present.
        at org.apache.axis2.AxisFault.makeFault(AxisFault.java:381)
        at org.apache.axis2.jaxws.server.JAXWSMessageReceiver.receive(JAXWSMessa
        geReceiver.java:149)
        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:144)
        at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostReq
        uest(HTTPTransportUtils.java:279)
        at org.apache.geronimo.axis2.pojo.POJOWebServiceContainer.processPostReq
        uest(POJOWebServiceContainer.java:78)
        at org.apache.geronimo.axis2.Axis2WebServiceContainer.doService2(Axis2We
        bServiceContainer.java:269)
        at org.apache.geronimo.axis2.Axis2WebServiceContainer.doService(Axis2Web
        ServiceContainer.java:192)
        at org.apache.geronimo.axis2.Axis2WebServiceContainer.invoke(Axis2WebSer
        viceContainer.java:141)
        at org.apache.geronimo.webservices.WebServiceContainerInvoker.service(We
        bServiceContainerInvoker.java:84)
        at org.apache.geronimo.webservices.POJOWebServiceServlet.service(POJOWeb
        ServiceServlet.java:79)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
        icationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
        ilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
        alve.java:228)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
        alve.java:175)
        at org.apache.geronimo.tomcat.valve.DefaultSubjectValve.invoke(DefaultSu
        bjectValve.java:56)
        at org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMethodValve.
        invoke(GeronimoStandardContext.java:324)
        at org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.invoke(Gero
        nimoBeforeAfterValve.java:47)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
        ava:128)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
        ava:104)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
        ve.java:109)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:
        543)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
        a:216)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
        :844)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
        ss(Http11Protocol.java:634)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:44
        5)
        at java.lang.Thread.run(Thread.java:595)
        Caused by: javax.xml.ws.WebServiceException: A Java method was not found for the
        operation. If the WSDL operation name is different from the Java method name, m
        ake sure that the @WebMethod annotation name is present.
        at org.apache.axis2.jaxws.ExceptionFactory.createWebServiceException(Exc
        eptionFactory.java:170)
        at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(Excep
        tionFactory.java:67)
        at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(Excep
        tionFactory.java:115)
        at org.apache.axis2.jaxws.server.dispatcher.JavaBeanDispatcher.getJavaMe
        thod(JavaBeanDispatcher.java:226)
        at org.apache.axis2.jaxws.server.dispatcher.JavaBeanDispatcher.invoke(Ja
        vaBeanDispatcher.java:73)
        at org.apache.axis2.jaxws.server.EndpointController.invoke(EndpointContr
        oller.java:151)
        at org.apache.axis2.jaxws.server.JAXWSMessageReceiver.receive(JAXWSMessa
        geReceiver.java:103)
        ... 24 more

        Am I missing something else in the sample? Thx, Lin

        Show
        Lin Sun added a comment - Updated the SEI per Jeff's comment. However, I still got similar exception on the client side - Exception in thread "main" javax.xml.ws.WebServiceException: org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character 'o' (code 111) in prolog; expected '<' at [row,col {unknown-source}]: [1,1] at org.apache.axis2.jaxws.ExceptionFactory.createWebServiceException(ExceptionFactory.java:172) at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:67) at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:125) at org.apache.axis2.jaxws.core.controller.AxisInvocationController.execute(AxisInvocationController.java:572) at org.apache.axis2.jaxws.core.controller.AxisInvocationController.doInvoke(AxisInvocationController.java:109) at org.apache.axis2.jaxws.core.controller.InvocationController.invoke(InvocationController.java:96) at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invokeSEIMethod(JAXWSProxyHandler.java:264) at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invoke(JAXWSProxyHandler.java:136) at $Proxy9.add(Unknown Source) at org.apache.geronimo.samples.jws.client.CalculatorClient.add(CalculatorClient.java:45) at org.apache.geronimo.samples.jws.client.CalculatorClient.main(CalculatorClient.java:33) Caused by: org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character 'o' (code 111) in prolog; expected '<' at [row,col {unknown-source} ]: [1,1] at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:211) at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(StAXSOAPModelBuilder.java:163) at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:111) at org.apache.axis2.builder.BuilderUtil.getSOAPBuilder(BuilderUtil.java:474) at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:130) at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:77) at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:356) at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:294) at org.apache.axis2.jaxws.core.controller.AxisInvocationController.execute(AxisInvocationController.java:567) ... 7 more Caused by: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character 'o' (code 111) in prolog; expected '<' at [row,col {unknown-source} ]: [1,1] at com.ctc.wstx.sr.StreamScanner.throwUnexpectedChar(StreamScanner.java:623) at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2047) at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069) at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:125) ... 15 more On my server side, I got - 14:45:57,515 ERROR [Axis2WebServiceContainer] Exception occurred while trying to invoke service method doService() org.apache.axis2.AxisFault: A Java method was not found for the operation. If th e WSDL operation name is different from the Java method name, make sure that the @WebMethod annotation name is present. at org.apache.axis2.AxisFault.makeFault(AxisFault.java:381) at org.apache.axis2.jaxws.server.JAXWSMessageReceiver.receive(JAXWSMessa geReceiver.java:149) at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:144) at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostReq uest(HTTPTransportUtils.java:279) at org.apache.geronimo.axis2.pojo.POJOWebServiceContainer.processPostReq uest(POJOWebServiceContainer.java:78) at org.apache.geronimo.axis2.Axis2WebServiceContainer.doService2(Axis2We bServiceContainer.java:269) at org.apache.geronimo.axis2.Axis2WebServiceContainer.doService(Axis2Web ServiceContainer.java:192) at org.apache.geronimo.axis2.Axis2WebServiceContainer.invoke(Axis2WebSer viceContainer.java:141) at org.apache.geronimo.webservices.WebServiceContainerInvoker.service(We bServiceContainerInvoker.java:84) at org.apache.geronimo.webservices.POJOWebServiceServlet.service(POJOWeb ServiceServlet.java:79) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl icationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF ilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV alve.java:228) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV alve.java:175) at org.apache.geronimo.tomcat.valve.DefaultSubjectValve.invoke(DefaultSu bjectValve.java:56) at org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMethodValve. invoke(GeronimoStandardContext.java:324) at org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.invoke(Gero nimoBeforeAfterValve.java:47) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j ava:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j ava:104) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal ve.java:109) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java: 543) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav a:216) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java :844) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce ss(Http11Protocol.java:634) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:44 5) at java.lang.Thread.run(Thread.java:595) Caused by: javax.xml.ws.WebServiceException: A Java method was not found for the operation. If the WSDL operation name is different from the Java method name, m ake sure that the @WebMethod annotation name is present. at org.apache.axis2.jaxws.ExceptionFactory.createWebServiceException(Exc eptionFactory.java:170) at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(Excep tionFactory.java:67) at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(Excep tionFactory.java:115) at org.apache.axis2.jaxws.server.dispatcher.JavaBeanDispatcher.getJavaMe thod(JavaBeanDispatcher.java:226) at org.apache.axis2.jaxws.server.dispatcher.JavaBeanDispatcher.invoke(Ja vaBeanDispatcher.java:73) at org.apache.axis2.jaxws.server.EndpointController.invoke(EndpointContr oller.java:151) at org.apache.axis2.jaxws.server.JAXWSMessageReceiver.receive(JAXWSMessa geReceiver.java:103) ... 24 more Am I missing something else in the sample? Thx, Lin

          People

          • Assignee:
            Jeff Barrett
            Reporter:
            Davanum Srinivas
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development