You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Thorsten Kunz <t....@gmx.de> on 2012/08/14 12:41:15 UTC

Exception when calling WebService

Hi,

I have a problem when I try to call a WebService with Apache CXF. The
wsdl2java generation works just fine and sending the request also works ok.
But when the answer is parsed and Exception is thrown. I am using CXF
version 2.6.1.

The WSDL can be found here:
http://webservice.broadcloudmeeting.com/perl/ilinc/api/webservice/ilinc-api.pl?ADMIN-WSDL

Request:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <ns1:VerifyClientSubdomain xmlns:ns1="urn:iLincAPI">
      <Authorization xmlns:ns2="urn:iLincAPI">
        <ns2:APIVersion>[removed]</ns2:APIVersion>
        <ns2:ClientID>[removed]</ns2:ClientID>
        <ns2:AuthorizedUserName>[removed]</ns2:AuthorizedUserName>
        <ns2:AuthorizedPassword>[removed]</ns2:AuthorizedPassword>
      </Authorization>
      <parameters xmlns:ns2="urn:iLincAPI">
        <ns2:Subdomain>[removed]</ns2:Subdomain>
      </parameters>
    </ns1:VerifyClientSubdomain>
  </soap:Body>
</soap:Envelope>

Response:
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
              xmlns:xsd="http://www.w3.org/2001/XMLSchema"
              soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
              xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <VerifyClientSubdomainResponse xmlns="urn:iLincAPI">
      <return>
        <ErrorID xsi:type="xsd:int">0</ErrorID>
        <DomainExists xsi:type="xsd:string">[removed]</DomainExists>
        <ErrorStr xsi:type="xsd:string" />
        <Reference xsi:nil="true" />
      </return>
    </VerifyClientSubdomainResponse>
  </soap:Body>
</soap:Envelope>

Exception:
org.apache.cxf.interceptor.Fault: Found element {urn:iLincAPI}return but
could not find matching RPC/Literal part
at
org.apache.cxf.binding.soap.interceptor.RPCInInterceptor.handleMessage(RPCInInterceptor.java:171)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:658)
at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2139)
at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2022)
at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1947)
at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:632)
at
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:472)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:302)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:254)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:123)
at $Proxy39.verifyClientSubdomain(Unknown Source)
at Test.test(Test.java:21)

Googling for the error seems to indicate that the WebService is not WS-I
Basic Profile compliant but I don't exactly get why. Is there and way I can
make this work? The problem is I have no influence on the server side so I
can't do anything about how the response looks like.

Any suggestions?

Thanks a lot

Re: Exception when calling WebService

Posted by Thorsten Kunz <t....@gmx.de>.
Thanks Daniel. Seems like this was it and removing the namespace from the
"return" element with the transformation feature did the trick.

2012/8/14 Daniel Kulp <dk...@apache.org>

>
> WS-I requires that for RPC/Literal, the accessor part elements ("return"
> in your example) be unqualified.  However, your server is sending it back
> qualified.
>
> You can use the transformation feature:
>
> http://cxf.apache.org/docs/transformationfeature.html
>
> to drop the namespace from that element which should allow the rest of the
> CXF processing to work.
>
>
> Dan
>
>
>
> On Aug 14, 2012, at 6:41 AM, Thorsten Kunz <t....@gmx.de> wrote:
>
> > Hi,
> >
> > I have a problem when I try to call a WebService with Apache CXF. The
> > wsdl2java generation works just fine and sending the request also works
> ok.
> > But when the answer is parsed and Exception is thrown. I am using CXF
> > version 2.6.1.
> >
> > The WSDL can be found here:
> >
> http://webservice.broadcloudmeeting.com/perl/ilinc/api/webservice/ilinc-api.pl?ADMIN-WSDL
> >
> > Request:
> > <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
> >  <soap:Body>
> >    <ns1:VerifyClientSubdomain xmlns:ns1="urn:iLincAPI">
> >      <Authorization xmlns:ns2="urn:iLincAPI">
> >        <ns2:APIVersion>[removed]</ns2:APIVersion>
> >        <ns2:ClientID>[removed]</ns2:ClientID>
> >        <ns2:AuthorizedUserName>[removed]</ns2:AuthorizedUserName>
> >        <ns2:AuthorizedPassword>[removed]</ns2:AuthorizedPassword>
> >      </Authorization>
> >      <parameters xmlns:ns2="urn:iLincAPI">
> >        <ns2:Subdomain>[removed]</ns2:Subdomain>
> >      </parameters>
> >    </ns1:VerifyClientSubdomain>
> >  </soap:Body>
> > </soap:Envelope>
> >
> > Response:
> > <?xml version="1.0" encoding="UTF-8"?>
> > <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> >              xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> >              xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> >              soap:encodingStyle="
> http://schemas.xmlsoap.org/soap/encoding/"
> >              xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
> >  <soap:Body>
> >    <VerifyClientSubdomainResponse xmlns="urn:iLincAPI">
> >      <return>
> >        <ErrorID xsi:type="xsd:int">0</ErrorID>
> >        <DomainExists xsi:type="xsd:string">[removed]</DomainExists>
> >        <ErrorStr xsi:type="xsd:string" />
> >        <Reference xsi:nil="true" />
> >      </return>
> >    </VerifyClientSubdomainResponse>
> >  </soap:Body>
> > </soap:Envelope>
> >
> > Exception:
> > org.apache.cxf.interceptor.Fault: Found element {urn:iLincAPI}return but
> > could not find matching RPC/Literal part
> > at
> >
> org.apache.cxf.binding.soap.interceptor.RPCInInterceptor.handleMessage(RPCInInterceptor.java:171)
> > at
> >
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
> > at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:658)
> > at
> >
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2139)
> > at
> >
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2022)
> > at
> >
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1947)
> > at
> org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
> > at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:632)
> > at
> >
> org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> > at
> >
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
> > at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:472)
> > at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:302)
> > at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:254)
> > at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> > at
> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:123)
> > at $Proxy39.verifyClientSubdomain(Unknown Source)
> > at Test.test(Test.java:21)
> >
> > Googling for the error seems to indicate that the WebService is not WS-I
> > Basic Profile compliant but I don't exactly get why. Is there and way I
> can
> > make this work? The problem is I have no influence on the server side so
> I
> > can't do anything about how the response looks like.
> >
> > Any suggestions?
> >
> > Thanks a lot
>
> --
> Daniel Kulp
> dkulp@apache.org - http://dankulp.com/blog
> Talend Community Coder - http://coders.talend.com
>
>

Re: Exception when calling WebService

Posted by Daniel Kulp <dk...@apache.org>.
WS-I requires that for RPC/Literal, the accessor part elements ("return" in your example) be unqualified.  However, your server is sending it back qualified.  

You can use the transformation feature:

http://cxf.apache.org/docs/transformationfeature.html

to drop the namespace from that element which should allow the rest of the CXF processing to work.


Dan



On Aug 14, 2012, at 6:41 AM, Thorsten Kunz <t....@gmx.de> wrote:

> Hi,
> 
> I have a problem when I try to call a WebService with Apache CXF. The
> wsdl2java generation works just fine and sending the request also works ok.
> But when the answer is parsed and Exception is thrown. I am using CXF
> version 2.6.1.
> 
> The WSDL can be found here:
> http://webservice.broadcloudmeeting.com/perl/ilinc/api/webservice/ilinc-api.pl?ADMIN-WSDL
> 
> Request:
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
>  <soap:Body>
>    <ns1:VerifyClientSubdomain xmlns:ns1="urn:iLincAPI">
>      <Authorization xmlns:ns2="urn:iLincAPI">
>        <ns2:APIVersion>[removed]</ns2:APIVersion>
>        <ns2:ClientID>[removed]</ns2:ClientID>
>        <ns2:AuthorizedUserName>[removed]</ns2:AuthorizedUserName>
>        <ns2:AuthorizedPassword>[removed]</ns2:AuthorizedPassword>
>      </Authorization>
>      <parameters xmlns:ns2="urn:iLincAPI">
>        <ns2:Subdomain>[removed]</ns2:Subdomain>
>      </parameters>
>    </ns1:VerifyClientSubdomain>
>  </soap:Body>
> </soap:Envelope>
> 
> Response:
> <?xml version="1.0" encoding="UTF-8"?>
> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>              xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
>              xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>              soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>              xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
>  <soap:Body>
>    <VerifyClientSubdomainResponse xmlns="urn:iLincAPI">
>      <return>
>        <ErrorID xsi:type="xsd:int">0</ErrorID>
>        <DomainExists xsi:type="xsd:string">[removed]</DomainExists>
>        <ErrorStr xsi:type="xsd:string" />
>        <Reference xsi:nil="true" />
>      </return>
>    </VerifyClientSubdomainResponse>
>  </soap:Body>
> </soap:Envelope>
> 
> Exception:
> org.apache.cxf.interceptor.Fault: Found element {urn:iLincAPI}return but
> could not find matching RPC/Literal part
> at
> org.apache.cxf.binding.soap.interceptor.RPCInInterceptor.handleMessage(RPCInInterceptor.java:171)
> at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
> at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:658)
> at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2139)
> at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2022)
> at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1947)
> at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:632)
> at
> org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:472)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:302)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:254)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:123)
> at $Proxy39.verifyClientSubdomain(Unknown Source)
> at Test.test(Test.java:21)
> 
> Googling for the error seems to indicate that the WebService is not WS-I
> Basic Profile compliant but I don't exactly get why. Is there and way I can
> make this work? The problem is I have no influence on the server side so I
> can't do anything about how the response looks like.
> 
> Any suggestions?
> 
> Thanks a lot

-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


Re: Exception when calling WebService

Posted by Glen Mazza <gm...@talend.com>.
Hi Thorsten, I can't see anything immediately that may be wrong.  CXF 
does support RPC/literal.  You might wish to create a Metro client (it's 
easy to do: http://www.jroller.com/gmazza/entry/soap_client_tutorial) to 
see, what, if any, different error messages it returns (or it might work 
OOTB).  This might help in indicating where the problem is (the server, 
the WSDL, or CXF).

If the problem is with the web service provider you may be able to 
modify the incoming SOAP response so a client exception won't occur.  
Some options for this: using JAX-WS handlers, CXF interceptors, or the 
CXF transformation feature: 
http://www.jroller.com/gmazza/entry/jaxwshandlers_to_cxfinterceptors#interceptorResources.

HTH,
Glen

On 08/14/2012 06:41 AM, Thorsten Kunz wrote:
> Hi,
>
> I have a problem when I try to call a WebService with Apache CXF. The
> wsdl2java generation works just fine and sending the request also works ok.
> But when the answer is parsed and Exception is thrown. I am using CXF
> version 2.6.1.
>
> The WSDL can be found here:
> http://webservice.broadcloudmeeting.com/perl/ilinc/api/webservice/ilinc-api.pl?ADMIN-WSDL
>
> Request:
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
>    <soap:Body>
>      <ns1:VerifyClientSubdomain xmlns:ns1="urn:iLincAPI">
>        <Authorization xmlns:ns2="urn:iLincAPI">
>          <ns2:APIVersion>[removed]</ns2:APIVersion>
>          <ns2:ClientID>[removed]</ns2:ClientID>
>          <ns2:AuthorizedUserName>[removed]</ns2:AuthorizedUserName>
>          <ns2:AuthorizedPassword>[removed]</ns2:AuthorizedPassword>
>        </Authorization>
>        <parameters xmlns:ns2="urn:iLincAPI">
>          <ns2:Subdomain>[removed]</ns2:Subdomain>
>        </parameters>
>      </ns1:VerifyClientSubdomain>
>    </soap:Body>
> </soap:Envelope>
>
> Response:
> <?xml version="1.0" encoding="UTF-8"?>
> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>                xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
>                xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>                soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>                xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
>    <soap:Body>
>      <VerifyClientSubdomainResponse xmlns="urn:iLincAPI">
>        <return>
>          <ErrorID xsi:type="xsd:int">0</ErrorID>
>          <DomainExists xsi:type="xsd:string">[removed]</DomainExists>
>          <ErrorStr xsi:type="xsd:string" />
>          <Reference xsi:nil="true" />
>        </return>
>      </VerifyClientSubdomainResponse>
>    </soap:Body>
> </soap:Envelope>
>
> Exception:
> org.apache.cxf.interceptor.Fault: Found element {urn:iLincAPI}return but
> could not find matching RPC/Literal part
> at
> org.apache.cxf.binding.soap.interceptor.RPCInInterceptor.handleMessage(RPCInInterceptor.java:171)
> at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
> at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:658)
> at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2139)
> at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2022)
> at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1947)
> at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:632)
> at
> org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:472)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:302)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:254)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:123)
> at $Proxy39.verifyClientSubdomain(Unknown Source)
> at Test.test(Test.java:21)
>
> Googling for the error seems to indicate that the WebService is not WS-I
> Basic Profile compliant but I don't exactly get why. Is there and way I can
> make this work? The problem is I have no influence on the server side so I
> can't do anything about how the response looks like.
>
> Any suggestions?
>
> Thanks a lot
>