cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andre (JIRA)" <j...@apache.org>
Subject [jira] Created: (CXF-2221) Missing Soap Headers
Date Fri, 15 May 2009 19:47:45 GMT
Missing Soap Headers
--------------------

                 Key: CXF-2221
                 URL: https://issues.apache.org/jira/browse/CXF-2221
             Project: CXF
          Issue Type: Bug
          Components: Soap Binding
    Affects Versions: 2.2.1, 2.1.5, 2.2, 2.1.4, 2.1.3, 2.1.2
         Environment: java -version
java version "1.6.0_12"
Java(TM) SE Runtime Environment (build 1.6.0_12-b04)
Java HotSpot(TM) 64-Bit Server VM (build 11.2-b01, mixed mode)

apache-tomcat 6.0.18
            Reporter: Andre


Hello everybody,

I have a bit trouble with the Soap Headers, they are just not generated...

this is my WSDL: https://api.webtrends.com/Services/AnalyticsDataService.asmx?WSDL
I generate the client code with "wsdl2java ... -exsh true ..."

my client code:


######################################################################################
import javax.xml.ws.Holder;

import org.apache.cxf.interceptor.LoggingInInterceptor;
import org.apache.cxf.interceptor.LoggingOutInterceptor;
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;

import com.webtrends.ws._1.AnalyticsDataService;
import com.webtrends.ws._1.WTCredentialsHeader;
import com.webtrends.ws._1.WTSessionHeader;

public class Main {

    /**
     * @param args
     */
    public static void main(String[] args) {
        JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
        factory.getInInterceptors().add(new LoggingInInterceptor());
        factory.getOutInterceptors().add(new LoggingOutInterceptor());
        factory.setServiceClass(AnalyticsDataService.class);
        factory.setAddress("https://api.webtrends.com/Services/AnalyticsDataService.asmx");
        AnalyticsDataService ads = (AnalyticsDataService) factory.create();

        WTCredentialsHeader credentials = new WTCredentialsHeader();
        credentials.setAccountName("foo");
        credentials.setUsername("bar");
        credentials.setPassword("baz");
        Holder<WTCredentialsHeader> credentialsHolder = new Holder<WTCredentialsHeader>(credentials);
        Holder<WTSessionHeader> sessionHolder = new Holder<WTSessionHeader>(new
WTSessionHeader());

        ads.checkAvailability(credentialsHolder, sessionHolder);

    }

}
######################################################################################





15.05.2009 08:01:43 org.apache.cxf.interceptor.LoggingOutInterceptor$LoggingCallback onClose
INFO: Outbound Message
---------------------------
Encoding: UTF-8
Headers: {SOAPAction=["http://www.webtrends.com/WS/1.0/CheckAvailability"], Accept=[*]}
Messages: 
Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><CheckAvailability
xmlns="http://www.webtrends.com/WS/1.0"/></soap:Body></soap:Envelope>
--------------------------------------
15.05.2009 08:01:45 org.apache.cxf.interceptor.LoggingInInterceptor logging
INFO: Inbound Message
----------------------------
Encoding: UTF-8
Headers: {content-type=[text/xml; charset=utf-8], X-AspNet-Version=[2.0.50727], Date=[Fri,
15 May 2009 06:01:45 GMT], Content-Length=[590], X-Powered-By=[ASP.NET], Server=[Microsoft-IIS/6.0],
Cache-Control=[private]}
Messages: 
Message:

Payload: <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><faultcode>soap:Client</faultcode><faultstring>Authentication
failed.</faultstring><faultactor>http://api.webtrends.com/Services/AnalyticsDataService.asmx</faultactor><detail><Reason
xmlns="http://www.webtrends.com/schemas/2006/01">Missing WTCredentialsHeader and WTSessionHeader
in SOAP message.</Reason></detail></soap:Fault></soap:Body></soap:Envelope>

--------------------------------------

Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Authentication failed.
	at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:199)
	at $Proxy59.checkAvailability(Unknown Source)
	at rbmh.webplayer.actions.Main.main(Main.java:33)
Caused by: org.apache.cxf.binding.soap.SoapFault: Authentication failed.
	at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:70)
	at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:35)
	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:220)
	at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:96)
	at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:69)
	at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:34)
	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:220)
	at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:449)
	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2029)
	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1865)
	at org.apache.cxf.io.CacheAndWriteOutputStream.postClose(CacheAndWriteOutputStream.java:47)
	at org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java:170)
	at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
	at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:593)
	at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:220)
	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:296)
	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:242)
	at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
	at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:178)
	... 2 more       

######################################################################################

like u can see. there is no Soap Header in the Outbound Message...
and now the very funny thing, i'm using maven, so it's very simple to switch to another version
of CXF
the stuff is working perfectly with the older cxf versions: 2.1, 2.1.1
but if i use the newer versions: 2.1.2, 2.1.3, 2.1.4, 2.1.5, 2.2, 2.2.1, i get the error above

how can that be? what is wrong

thanks in dvance

regards
andre

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message