cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Lipofsky" <Daniel.Lipof...@bricsnet.com>
Subject RE: trying to use ClientProxyFactoryBean but failing
Date Tue, 11 Mar 2008 03:02:13 GMT
Yes it does.  That works!
Thanks,
Dan 

Willem Jiang wrote:
> 
> Hi,
> 
> Do your TxPortType.class has the @WebService annotation?
> If so, please use the JaxWsClientFactoryBean which will take care of 
> this annotation to create the proxy.
> Here is the  code snippet.
> 
> ClientProxyFactoryBean factory = new 
> ClientProxyFactoryBean(new JaxWsClientFactoryBean());
> 
> .......
> 
> 
> Willem.
> 
> Daniel Lipofsky wrote:
> > Ah, I should have though of that.
> > It's very informative.
> >
> > The HTML I am getting back basically says it is a 401 error
> > with the message "This request requires HTTP authentication".
> >
> > It appears the auth info in not getting transmitted.
> > I added logging interceptors for both IN and OUT.
> > On the outbound I see
> >
> > Headers: {SOAPAction=[""], Accept=[*]}
> >
> > If I use the other technique (where I call new
> > TxService().getTxPort() and add the auth to the
> > getRequestContext() map) I see
> >
> > Headers: {Authorization=[Basic .........=], SOAPAction=[""],
Accept=[*]}
> >
> > So I tried this and it seemed to work for authorization:
> >
> >   ClientProxyFactoryBean factory = new ClientProxyFactoryBean();
> >   factory.setServiceClass(TxPortType.class);
> >   factory.setAddress("http://localhost/ws/services/Tx");
> >   TxPortType port = (TxPortType)factory.create();
> >   Client client = factory.getClientFactoryBean().getClient();
> >   HTTPConduit httpConduit = (HTTPConduit) client.getConduit();
> >   AuthorizationPolicy authorization = new AuthorizationPolicy();
> >   authorization.setUserName(...);
> >   authorization.setPassword(...);
> >   httpConduit.setAuthorization(authorization);
> >   ...
> >   port.getObjects(new ArrayList<SearchTerm>(0), 0, 0);
> >
> >
> > *BUT* now my next problem.  I am getting
> >
> >
> >  org.apache.cxf.binding.soap.SoapFault: Message part
> >  {http://jaxws.impl.ws.core.bricsnet.com/}getObjects was 
> not recognized.
> >
> > That namespace is clearly wrong, it should be using
> > {http://www.bricsnet.com/Tx}.  I can see the wrong namespace
> > in the outbound soap message.  But how do I fix that?
> >
> > Thanks,
> > Dan
> >
> >
> >
> > On Monday 10 March 2008, Daniel Kulp wrote:
> >   
> >> You're getting HTML back for some reason instead of a soap message.
> >>
> >> My only suggestion would be to do:
> >>
> >> client.getInInterceptor().add(new 
> >> org.apache.cxf.interceptor.LoggingInInterceptor());
> >>
> >> and see what it prints out.  The HTML might give a clue.
> >>
> >> Dan

Mime
View raw message