Hello

I've made a service using JAXB, JSR-181 and the code first aproach.

@WebService(name = "CustomerService", serviceName = "CustomerService",
targetNamespace = "http://wsp.dinamogest.pt)
@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use =
SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED
)
public class CustomerServiceImpl implements CustomerService {
      public Customer load(Enterprise enterprise, String customerCode) {
      }

      public Customer loadByNif(Enterprise enterprise, String nif) {
      }
}

Note: Generated WSDL is below!


SoapUI Generated wrapped requests for the WSDL thus seeing my service as
doc-lit.wrapped service.


Then I generated client (and server) using WsGenTask :

 <target name="WSDL2Java">
       <wsgen outputDirectory="${src.dir}"
                 wsdl="${wsdl}"
              package="pt.dinamogest.wsp.client.wsgen"
              overwrite="true"/>
   </target>

but the result is not
a doc-literal wrapped client & server but doc-literal bare:

@WebService(name = "CustomerService", targetNamespace = "
http://wsp.dinamogest.pt";)
@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use =
SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.BARE)
public interface CustomerService {
   @WebMethod(operationName = "loadByNif", action = "")
   @WebResult(name = "loadByNifResponse", targetNamespace = "
http://wsp.dinamogest.pt";)
   public LoadByNifResponse loadByNif(
       @WebParam(name = "loadByNif", targetNamespace = "
http://wsp.dinamogest.pt";)
       LoadByNif loadByNif);

   @WebMethod(operationName = "load", action = "")
   @WebResult(name = "loadResponse", targetNamespace = "
http://wsp.dinamogest.pt";)
   public LoadResponse load(
       @WebParam(name = "load", targetNamespace = "http://wsp.dinamogest.pt
")
       Load load);
}


when I read "How to generate Wrapped-style code using wsgen?" (24th May by )
I thought that it described my case as I was also using different namespaces
for service and types.
But I unified the namespace and the problem persists.

I using the embedded xfire http server and the
org.codehaus.xfire.jaxb2.JaxbServiceFactory service factory. My JDK is Java
1.6

I've triple-checked all my steps but can't figure out what's wrong.

Can someone give me any kind of feedback on this issue?

Thanks
Cheers

MG



WSDL:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions  targetNamespace="http://wsp.dinamogest.pt";
xmlns:soapenc12="http://www.w3.org/2003/05/soap-encoding";
xmlns:tns="http://wsp.dinamogest.pt";
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:soap11="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/";
xmlns:soapenc11="http://schemas.xmlsoap.org/soap/encoding/";
xmlns:soap12="http://www.w3.org/2003/05/soap-envelope";>
 <wsdl:types>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema";
attributeFormDefault="qualified" elementFormDefault="qualified"
targetNamespace="http://wsp.dinamogest.pt";>
<xsd:element name="loadByNif">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" ref="tns:Enterprise"/>
<xsd:element maxOccurs="1" minOccurs="1" name="nif" nillable="true"
type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="loadByNifResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" ref="tns:Customer"/>

</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="load">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" ref="tns:Enterprise"/>
<xsd:element maxOccurs="1" minOccurs="1" name="customerCode"
nillable="true" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="loadResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" ref="tns:Customer"/>
</xsd:sequence>
</xsd:complexType>

</xsd:element>
<xs:element xmlns:xs="http://www.w3.org/2001/XMLSchema"; name="Enterprise">
<xs:complexType>
<xs:sequence>
<xs:element name="code" type="xs:string"/>
<xs:element minOccurs="0" name="name" type="xs:string"/>
<xs:element name="username" type="xs:string"/>
<xs:element name="password" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element xmlns:xs="http://www.w3.org/2001/XMLSchema"; name="Customer">
<xs:complexType>
<xs:sequence>
<xs:element name="code" nillable="true" type="xs:string"/>
<xs:element name="name" type="xs:string"/>
<xs:element xmlns:ns1="http://wsp.dinamogest.pt"; ref="ns1:Address"/>

<xs:element name="nif" type="xs:string"/>
<xs:element name="coin" type="xs:string"/>
<xs:element name="paymentType" type="xs:string"/>
<xs:element name="paymentCondition" type="xs:string"/>
<xs:element minOccurs="0" name="nib" type="xs:string"/>
<xs:element minOccurs="0" name="phone" type="xs:string"/>
<xs:element minOccurs="0" name="mobilePhone" type="xs:string"/>
<xs:element minOccurs="0" name="fax" type="xs:string"/>
<xs:element minOccurs="0" name="email" type="xs:string"/>
<xs:element minOccurs="0" name="site" type="xs:string"/>
<xs:element name="market" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element xmlns:xs="http://www.w3.org/2001/XMLSchema"; name="Address">
<xs:complexType>
<xs:sequence>

<xs:element minOccurs="0" name="street" type="xs:string"/>
<xs:element name="city" type="xs:string"/>
<xs:element name="zipCode" type="xs:string"/>
<xs:element minOccurs="0" name="zipCodeCity" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xsd:schema>
 </wsdl:types>
 <wsdl:message name="loadByNifResponse">
   <wsdl:part name="parameters" element="tns:loadByNifResponse">
   </wsdl:part>
 </wsdl:message>

 <wsdl:message name="loadResponse">
   <wsdl:part name="parameters" element="tns:loadResponse">
   </wsdl:part>
 </wsdl:message>
 <wsdl:message name="loadRequest">
   <wsdl:part name="parameters" element="tns:load">
   </wsdl:part>
 </wsdl:message>
 <wsdl:message name="loadByNifRequest">

   <wsdl:part name="parameters" element="tns:loadByNif">
   </wsdl:part>
 </wsdl:message>
 <wsdl:portType name="CustomerService">
   <wsdl:operation name="loadByNif">
     <wsdl:input name="loadByNifRequest" message="tns:loadByNifRequest">
   </wsdl:input>
     <wsdl:output name="loadByNifResponse" message="tns:loadByNifResponse">
   </wsdl:output>

   </wsdl:operation>
   <wsdl:operation name="load">
     <wsdl:input name="loadRequest" message="tns:loadRequest">
   </wsdl:input>
     <wsdl:output name="loadResponse" message="tns:loadResponse">
   </wsdl:output>
   </wsdl:operation>
 </wsdl:portType>
 <wsdl:binding name="CustomerServiceHttpBinding" type="tns:CustomerService">

   <wsdlsoap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
   <wsdl:operation name="loadByNif">
     <wsdlsoap:operation soapAction=""/>
     <wsdl:input name="loadByNifRequest">
       <wsdlsoap:body use="literal"/>
     </wsdl:input>
     <wsdl:output name="loadByNifResponse">
       <wsdlsoap:body use="literal"/>
     </wsdl:output>

   </wsdl:operation>
   <wsdl:operation name="load">
     <wsdlsoap:operation soapAction=""/>
     <wsdl:input name="loadRequest">
       <wsdlsoap:body use="literal"/>
     </wsdl:input>
     <wsdl:output name="loadResponse">
       <wsdlsoap:body use="literal"/>
     </wsdl:output>

   </wsdl:operation>
 </wsdl:binding>
 <wsdl:service name="CustomerService">
   <wsdl:port name="CustomerServiceHttpPort"
binding="tns:CustomerServiceHttpBinding">
     <wsdlsoap:address location="http://127.0.0.1:8088/CustomerService"/>
   </wsdl:port>
 </wsdl:service>
</wsdl:definitions>

Reply via email to