[
https://issues.apache.org/jira/browse/AXIS2-2353?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12485295
]
Jeff Barrett commented on AXIS2-2353:
-------------------------------------
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
> Selecting a port name / wsdl provided scenario
> ----------------------------------------------
>
> Key: AXIS2-2353
> URL: https://issues.apache.org/jira/browse/AXIS2-2353
> Project: Axis 2.0 (Axis2)
> Issue Type: Bug
> Components: jaxws
> Reporter: Davanum Srinivas
> Assigned To: Jeff Barrett
> Attachments: CalculatorClient.java, CalculatorService.java,
> CalculatorService.wsdl
>
>
> 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
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]