The problem is that wsdl2java generates JAX-WS compatible code, but you 
are using the simple frontend (instead of the jax-ws frontend) without 
specifying the wsdl. (just the service address)

Most likely, you would just need to change the :
new ClientProxyFactoryBean();
to
new JaxWsProxyFactoryBean();
and it may work fine.

Alternatively, you may be able to call factory.
factory.setWsdlLocation(....)
to specify the location of the wsdl so it can get the proper namespaces 
and stuff out of there.

Dan 


On Thursday 04 October 2007, Jarada, Hussam wrote:
> Hi,
>
> I am using wsdl2java tool to generate client stub library for the
> client as follows
> C:\Program Files\Apache Software
> Foundation\apache-cxf-2.0.2-incubator\bin>wsdl2java.bat -d
> C:\svnwork\reg\trunk\reg\reg-ws\ws-madcap\src\main\java -compile -all
> -exsh true -verbose
> C:\svnwork\reg\trunk\reg\reg-ws\ws-madcap\src\wsdl\madcap.wsdl
>
> then from my client side I am calling
> import org.apache.cxf.frontend.ClientProxyFactoryBean;
>
> import com.aol.madcap._2007._06.*;
>
> ClientProxyFactoryBean factory = new ClientProxyFactoryBean();
>
> factory.setServiceClass(com.aol.madcap._2007._06.MadcapPort.class);
>
> factory.setAddress(getServiceURL());
>
> MadcapPort port = (com.aol.madcap._2007._06.MadcapPort)
> factory.create();
>
> Then invoke reserveLoginId
>
>
>
> From logging
>
> Oct 4, 2007 11:38:06 AM
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean
> buildServiceFromClass
> INFO: Creating Service {http://_06._2007.madcap.aol.com/}MadcapPort
> from class com.aol.madcap._2007._06.MadcapPort
> Oct 4, 2007 11:39:18 AM
> org.apache.cxf.interceptor.LoggingOutInterceptor$LoggingCallback
> onClose INFO: Outbound Message
> --------------------------------------
> <soap:Envelope
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";><soap:Body><res
>er veLoginId
> xmlns="http://_06._2007.madcap.aol.com/";><loginIdReservation
> xmlns:ns2="http://madc
> ap.aol.com/2007/06"
> reserveSeconds="5"><ns2:loginId><ns2:name>HussamJarada</ns2:name><ns2:
>do
> mainInfo><ns2:domain>aol.in</ns2:domain><ns2:bid>17</ns2:bid><ns2:lang
>-l ocale>en-in</ns2
>
> :lang-locale></ns2:domainInfo></ns2:loginId></loginIdReservation></res
> :er
>
> veLoginId></soap:Body></soap:Envelope>
> --------------------------------------
> Oct 4, 2007 11:39:19 AM
> org.apache.cxf.interceptor.LoggingInInterceptor handleMessage
> INFO: Inbound Message
> --------------------------------------
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <SOAP-ENV:Envelope
> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";
> xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/";
> xmlns:xsi="http://www.w3.org/2001/XMLSchema
> -instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema";
> xmlns:mc="http://madcap.aol.com/2006/10";><SOAP-ENV:Header/><SOAP-ENV:B
>od y><SOAP-ENV:Fault><SOAP-ENV:faultcode>SOAP-ENV:Sende
> r</SOAP-ENV:faultcode><SOAP-ENV:faultstring>Invalid
> namespace</SOAP-ENV:faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOA
>P- ENV:Envelope>
>
> --------------------------------------
>
> The backend server report invalid namespace cause in the soap body
> reserveLoginId xmlns=http://_06._2007.madcap.aol.com/  at which it
> should be xmlns:ns2="http://madc <http://madc/>
> ap.aol.com/2007/06"
>
> Can someone please help me in resolving this issue, I tried using
> early Xfire 1.2.6, then CXF 2.0 then 2.0.1 all report issues related
> to namespace.
>
> why CXF 2.0.2 wsdl2java generate a soap body with
> xmlns="http://_06._2007.madcap.aol.com
> <http://_06._2007.madcap.aol.com/";><loginIdReservation>  ? since the
> wsdl we have
>
> Do I have issue in my wsdl2java arugments or the way I invoke the web
> service from the ClientProxyFactoryBean?
>
> targetNamespace=http://madcap.aol.com/2007/06
>
> Thanks in advance,
>
> Jarada



-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194
[EMAIL PROTECTED]
http://www.dankulp.com/blog

Reply via email to