On Thu June 18 2009 11:12:20 am Jonathan Macke wrote: > It works fine when I'm using the @WebParam annotation. Thanks a lot! > > I'm using the following config in the package-info: > @XmlSchema( > namespace="urn:xastory:csm:contract", > elementFormDefault = XmlNsForm.QUALIFIED > ) > @XmlAccessorType(XmlAccessType.FIELD) > package net.atos.xastory.csm.contract; > > I also tried with a client that uses the Sun-based (Metro) implementation > of JAX-WS and the xmlns attribute is also empty. > Does it mean that Axis2 and Metro do not implement correctly the > elementFormDefault attribute when no WebParam is defined ?
It's possibly a bug in CXF as well. Most likely, the generated wsdl should have marked that single element non-qualified. I would definitely try with CXF 2.1.5 (or 2.2.2) as I know some fixes around the WebParam handling went in for some Geronimo things. That said, since you want the schema qualified, having the targetNamespace attribute on the WebParam is definitely the way to go. Dan > > Jonathan > > dkulp wrote: > > Two thoughts: > > > > 1) Definitely upgrade to CXF 2.2.2 or at least 2.1.5. We're going to > > stop > > supporting 2.0.x very soon. (July) Also 2.1 clarified some of the > > namespace > > mapping/handling a bit better so that alone might fix it. > > > > 2) In the wsdl returned from: > > http://localhost:8080/net.atos.xastory.csm.contract.CatalogueStockManagem > >entService?wsdl what does the schema say for the elementFormDefault? If > > it says "qualified", > > then the Axis2 message is wrong. > > > > You MAY be able to get them to work together if you add a @WebParam > > annotation > > like: > > net.atos.xastory.csm.contract.WithdrawProductOutput withdrawProducts( > > @WebParam(name = "input", > > targetNamespace="urn:xastory:csm:contract") > > net.atos.xastory.csm.contract.WithdrawProductInput input) > > > > Dan > > > > On Thu June 18 2009 9:55:12 am Jonathan Macke wrote: > >> Hi, > >> > >> I wrote a simple service using the JAX-WS API. > >> > >> @WebService(targetNamespace = "urn:xastory:csm:contract") > >> public interface CatalogueStockManagementService { > >> > >> @WebMethod > >> net.atos.xastory.csm.contract.WithdrawProductOutput withdrawProducts( > >> net.atos.xastory.csm.contract.WithdrawProductInput > >> input) > >> throws net.atos.xastory.csm.contract.ServiceException; > >> } > >> > >> Technical Environment: > >> - CXF 2.0.11 > >> - Tomcat 5.5 > >> - JAXB 2.0 > >> > >> > >> I tried to used this service with a Axis2-based client using JAX-WS. > >> > >> @Test > >> public void testAxis2Jaxws() throws Exception{ > >> > >> URL wsdl = new > >> URL("http://localhost:8080/net.atos.xastory.csm.contract.CatalogueStockM > >>ana gementService?wsdl"); > >> > >> QName qname = new QName("http://provider.csm.xastory.atos.net/", > >> "CatalogueStockManagementServiceImplService"); > >> Service service = Service.create(wsdl, qname); > >> > >> CatalogueStockManagementService catalogueService = > >> service.getPort(CatalogueStockManagementService.class); > >> > >> WithdrawProductInput input = new WithdrawProductInput(); > >> > >> //fill the input object > >> > >> WithdrawProductOutput output = > >> catalogueService.withdrawProducts(input); > >> > >> } > >> > >> From the server side, input is null. I tried with a CXF-based client, > >> I'm getting the input properly filled. > >> > >> > >> Here is the SOAP request generated by the CXF client: > >> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> > >> <soap:Body> > >> <ns1:withdrawProducts xmlns:ns1="urn:xastory:csm:contract"> > >> <arg0 xmlns="urn:xastory:csm:contract"> > >> <products> > >> <externalReference>2</externalReference> > >> <quantity>3</quantity> > >> <currentPrice> > >> <amount>12.0</amount> > >> <currency>EUR</currency> > >> </currentPrice> > >> <taxes> > >> <percentage>20</percentage> > >> <taxType>taxType</taxType> > >> </taxes> > >> </products> > >> </arg0> > >> </ns1:withdrawProducts> > >> </soap:Body> > >> </soap:Envelope> > >> > >> Here is the SOAP request generated by the Axis2 client: > >> <?xml version='1.0' encoding='UTF-8'?> > >> <soapenv:Envelope > >> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> > >> <soapenv:Body> > >> <dlwmin:withdrawProducts > >> xmlns:dlwmin="urn:xastory:csm:contract"> > >> <arg0 xmlns=""> > >> <dlwmin:products> > >> > >> <dlwmin:externalReference>2</dlwmin:externalReference> > >> <dlwmin:quantity>3</dlwmin:quantity> > >> <dlwmin:currentPrice> > >> <dlwmin:amount>12.0</dlwmin:amount> > >> > >> <dlwmin:currency>EUR</dlwmin:currency> </dlwmin:currentPrice> > >> <dlwmin:taxes> > >> > >> <dlwmin:percentage>20</dlwmin:percentage> > >> <dlwmin:taxType>taxType</dlwmin:taxType> </dlwmin:taxes> > >> </dlwmin:products> > >> </arg0> > >> </dlwmin:withdrawProducts> > >> </soapenv:Body> > >> </soapenv:Envelope> > >> > >> In Axis2 the xmlns attribute is empty for the arg0 element. CXF seems > >> not able to treat requests with an empty xmlns in the arg0 element. > >> > >> Do you have any idea to solve this problem? > >> > >> > >> Jonathan > > > > -- > > Daniel Kulp > > [email protected] > > http://www.dankulp.com/blog -- Daniel Kulp [email protected] http://www.dankulp.com/blog
