Details
Description
I am currently using xfire 1.2.4 with JAXB 2.0 and the annotations introduced in JSR 181 for creating a web service.
I have experienced difficulty setting the partName property for the WebResult and WebParam annotations and hoped to get some feedback as to whether this is known behaviour or whether there are any additional steps that I need to take to allow this behaviour.
According to JSR 181, the partName can be used if the operation is rpc style or if the operation is document style and the parameter style is BARE. I have included the code for the service below which should be using document style and BARE, as set in the SOAPBinding annotation. However, the partName property is ommited from the generated wsdl (also below).
This particular issue has been noticed using both org.codehaus.xfire.jaxb2.JaxbServiceFactory and org.codehaus.xfire.jaxws.JAXWSServiceFactory. Interestingly, the org.codehaus.xfire.jaxb2.JaxbServiceFactory sets the part name in the wsdl to 'return', whereas the org.codehaus.xfire.jaxws.JAXWSServiceFactory sets the part name to 'parameters'. This occurs irrespective of what is specified in the WebResult and WebParam annotations.
We currently need the functionality offered by the JaxbServiceFactory and are unable to move forward without the ability to set the partName, or have the partName default to 'paramters' as is the case with the org.codehaus.xfire.jaxws.JAXWSServiceFactory.
Any information
Services.xml
<beans xmlns="http://xfire.codehaus.org/config/1.0">
<service>
<serviceClass>matt.test.MyServiceImpl</serviceClass>
<serviceFactory>org.codehaus.xfire.jaxb2.JaxbServiceFactory</serviceFactory>
</service>
</beans>
MyServiceImpl.java
package matt.test;
import java.util.Collections;
import javax.jws.WebParam;
import javax.jws.WebService;
import javax.jws.WebMethod;
import javax.jws.WebResult;
import javax.jws.soap.SOAPBinding;
import java.util.*;
@WebService(name="Hello", serviceName="HelloService", targetNamespace="http://example.com")
@SOAPBinding(parameterStyle=SOAPBinding.ParameterStyle.BARE, style=SOAPBinding.Style.DOCUMENT, use=SOAPBinding.Use.LITERAL)
public class MyServiceImpl {
public MyServiceImpl() {
}
@WebMethod
@WebResult(partName="parameters")
public String hello(@WebParam(partName="parameters") String input)
}
http://127.0.0.1:7001/TestApp2/services/HelloService?wsdl
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://example.com" xmlns:tns="http://example.com" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc11="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenc12="http://www.w3.org/2003/05/soap-encoding" xmlns:soap11="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://example.com">
<xsd:element name="input" type="xsd:string"/>
<xsd:element name="return" type="xsd:string"/>
</xsd:schema>
</wsdl:types>
<wsdl:message name="helloRequest">
<wsdl:part name="input" element="tns:input">
</wsdl:part>
</wsdl:message>
<wsdl:message name="helloResponse">
<wsdl:part name="return" element="tns:return">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="Hello">
<wsdl:operation name="hello">
<wsdl:input name="helloRequest" message="tns:helloRequest">
</wsdl:input>
<wsdl:output name="helloResponse" message="tns:helloResponse">
</wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="HelloServiceHttpBinding" type="tns:Hello">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="hello">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="helloRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="helloResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="HelloService">
<wsdl:port name="HelloServiceHttpPort" binding="tns:HelloServiceHttpBinding">
<wsdlsoap:address location="http://127.0.0.1:7001/TestApp2/services/HelloService"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>