cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bc. Jiří Mikulášek" <jiri.mikula...@aura.cz>
Subject Re: JAXB Bindings problem in runtime
Date Fri, 19 Oct 2007 08:45:48 GMT
Hi,
we are using cxf 2.0, we are using wsdl provided by SAP in Norway (and because 
we don't speak Norwegian and whole application is developed in english we 
have done this jaxws and jaxb binding customization).

So, we are developing client side using cxf, soap binding is document/literal 
wrapped. We are using soapui to mock the service side (it is a tool which can 
import wsdl and simply mock the service). We are logging from cxf both 
requests and response.

Jaxb binding is customized both for request and response wrapper. While 
generating request, everything is OK and problem is while handling response.

Our client is started by this code:
NoMilSapNumberLookupService service = new NoMilSapNumberLookupService(wsdlUrl, 
serviceName);
        service.getZMMMATEXISTMATNRSoapBinding().existSapNumber(
                ASKING_SYSTEM, 
                sapNumber,
                status, 
                nsn, 
                description);

shortened client stub:

@WebServiceClient(name = "ZMM_MAT_EXIST_MATNRService", targetNamespace 
= "urn:sap-com:document:sap:soap:functions:mc-style")
public class NoMilSapNumberLookupService extends Service {

public NoMilSapNumberLookupService(URL wsdlLocation, QName serviceName) {
        super(wsdlLocation, serviceName);
    }
}

see wsdl and binding customization in attachment.

On Friday 19 of October 2007 09:58:20 Jim Ma wrote:
> Hi ,
> Could you tell me more information about this issue ?
> Which version CXF did you  use ?
> How did you start  and call this service ?
>
> Cheers
>
> Jim
>
> Bc. Jiří Mikulášek wrote:
> > Hi all,
> > I have used wsdl2java with external binding file specified through -b. My
> > stubs for client have been generated correctly, but I got in trouble
> > during runtime.
> >
> > The point is, that have renamed response properties names. But it seems
> > that cxf ignores jaxb annotations when handling the response wrapper.
> >
> > More concretly
> >
> > thanks to this part of external binding file:
> >  <jaxws:bindings
> > node="wsdl:definitions/wsdl:types/xsd:schema[@targetNamespace='urn:sap-co
> >m:document:sap:soap:functions:mc-style']">
> >
> >             <jaxb:bindings
> > node="xsd:element[@name='ZBapiMaterialExistsMatnrResponse']/xsd:complexTy
> >pe/xsd:sequence/xsd:element[@name='MaterialFinnes']"> <jaxb:property
> > name="existMark" />
> >             </jaxb:bindings>
> >
> >     </jaxws:bindings>
> >
> > this code is generated:
> >
> >  @XmlElement(name = "MaterialFinnes", required = true)
> >     protected String existMark;
> >
> > public String getExistMark() {
> >         return existMark;
> >     }
> >
> >     public void setExistMark(String value) {
> >         this.existMark = value;
> >     }
> >
> > but when trying to use this client against some mockservice generated
> > from the same wsdl I got:
> >
> > Caused by: java.lang.NoSuchMethodException:
> > cz.aura.isl.katalog.davky.control.sapnorway.sapnumberlookup.SapNumberLook
> >upResponse.getMaterialFinnes() at
> > org.apache.cxf.jaxb.WrapperHelper.getWrappedPart(WrapperHelper.java:194)
> >         at
> > org.apache.cxf.jaxws.interceptors.WrapperClassInInterceptor.handleMessage
> >(WrapperClassInInterceptor.java:136) ... 70 more



-- 
Jiri Mikulasek
---------------------------------
Developer

AURA, s.r.o.
Uvoz 499/56; 602 00 Brno
ISO 9001 certified company
AQAP 2110 (ČOS 051622)
tel./fax: +420 544 508 115
e-mail:  mikulasek@aura.cz
http://www.aura.cz
---------------------------------

Mime
View raw message