javaee / metro-jax-ws

https://javaee.github.io/metro-jax-ws/
Other
132 stars 68 forks source link

WebParam is not recognized properly #1180

Open glassfishrobot opened 9 years ago

glassfishrobot commented 9 years ago

As I described there at Stackoverflow I have a problem with the generated WSDL (and hence the SOAP processing) of my deployed JAX-WS project.

I'm starting with a WSDL definition. Here is the important snippet:

<message name="checkServiceRequest">
  <part name="checkServiceRequestPart" element="tns:CheckServiceRequest" />
</message>

The maven plugin generates the corresponding java code.

@WebParam(name = "CheckServiceRequest", 
  targetNamespace = "http://my.name.space", 
  partName = "checkServiceRequestPart")

The generated WSDL by the server runtime looks like this:

<message name="checkService">
  <part name="checkService" element="tns:checkService"/>
</message>

I'm using the generated java code for my port type to implement a SOAP consumer this way:

TestService soapClient = new TestService();
TestServicePortType soapPort = soapClient.getTestServicePort();
[...]
// do something with BindingProvider [...]
CheckServiceRequestType param = new CheckServiceRequestType();
CheckServiceResponseType response = soapPort.checkService(param);

This makes a SOAP call:

<?xml version="1.0" ?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">    <S:Body>
        <ns2:CheckServiceRequest xmlns:ns2="http://my.name.space">          <param>Hello World</param>
        </ns2:CheckServiceRequest>
    </S:Body>
</S:Envelope>

The problem is, that

CheckServiceRequest

is not recognized by the server runtime and this results in a

javax.xml.ws.soap.SOAPFaultException: Cannot find dispatch method for ...

.

If I use the generated WSDL as a source for a client call e.g. with SoapUI, the request looks like this and works:

<soapenv:Body>
      <ns:checkService>
         <param>FooBar</param>
      </ns:checkService>
   </soapenv:Body>

So, overall I've the impression the server side JAX-WS runtime does interpret the @WebParam annotation in a wrong way.

Environment

Windows 7, JDK 1.7.0_60, JDK 1.8.0_40, WebLogic 12c (12.1.3), JAX-WS RI 2.2.10

Affected Versions

[2.2.10]

glassfishrobot commented 9 years ago

Reported by sbiebr

glassfishrobot commented 9 years ago

sbiebr said: Running the service on a JBoss EAP 6.3.0, it works as I expected.

But JBoss has an own implementation.

Specification-Title:            JSR-000224: Java(TM) API for XML-Based Web Services
Specification-Version:      2.2
Implementation-Title:       Java(TM) API for XML-Based Web Services 2.2
Implementation-Vendor:      JBoss by Red Hat
Implementation-Version:             2.0.2.Final-redhat-1

The server generated WSDL looks for the message part above like this:

<message name="checkService">
  <part element="tns:CheckServiceRequest" name="checkServiceRequestPart"></part>
</message>
glassfishrobot commented 7 years ago

This issue was imported from java.net JIRA JAX_WS-1180