You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Sonam Nepali <So...@imail.org> on 2011/02/22 22:00:13 UTC

wsdl converted to java and calling using Cxf client not working

Hi

I have converted a wsdl to java using Metro webstack framework tool and using CXF client to invoke the services.

I have two methods in this generated java class: first one is  a oneway method and the other a request-response method.
I am able to get the oneway method to work but the requeset-response method fails upon invocation.  The following is the error:

Feb 22, 2011 1:56:48 PM org.apache.cxf.interceptor.LoggingInInterceptor logging
INFO: Inbound Message
----------------------------
ID: 1
Encoding: UTF-8
Content-Type: text/xml
Headers: {SOAPAction=[""]}
Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:hello xmlns:ns2="http://services.sample.services.ihc.org/"/></soap:Body></soap:Envelope>
--------------------------------------
Feb 22, 2011 1:56:48 PM org.apache.cxf.phase.PhaseInterceptorChain doIntercept
WARNING: Interceptor has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Message part {http://services.sample.services.ihc.org/}hello was not recognized.  (Does it exist in service WSDL?)
      at org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(DocLiteralInInterceptor.java:184)
      at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
      at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:104)
      at org.apache.cxf.transport.local.LocalConduit$1$1.run(LocalConduit.java:132)
      at java.lang.Thread.run(Unknown Source)
Feb 22, 2011 1:56:48 PM org.apache.cxf.interceptor.LoggingOutInterceptor$LoggingCallback onClose


Any thoughts on why my two way method fails?

Thanks

Sonam Nepali

Re: wsdl converted to java and calling using Cxf client not working

Posted by Glen Mazza <gm...@talend.com>.
I'm not sure of your need for the local transport, we primarily use that 
for some JUnit test cases where we don't want to rely on any ports.  
Embedded Jetty via Endpoint.publish() should be fine for non servlet 
container hosted environments.  But now that we've eliminated the 
wsimport/wsdl2java from the equation, the next step would probably be to 
host the web service via Endpoint.publish() (i.e.., embedded Jetty)[1] 
or a servlet-hosted web service[2] and see if you get the same problem, 
if not that would indicate something wrong with the local transport, if 
so the problem is probably with the WSDL or your coding somewhere.

Alternatively, can you post a minimal WSDL that reproduces the problem 
(don't send anything sensitive) -- as a sanity check I want to make sure 
you indeed have {http://services.sample.services.ihc.org/}hello as an 
acceptable input for a web service, also that you're not using an 
RPC/encoded WSDL which wouldn't work with JAX-WS anyway.

Glen

[1] http://www.jroller.com/gmazza/entry/junit_web_service_testing
[2] http://www.jroller.com/gmazza/entry/web_service_tutorial


On 2/22/2011 5:32 PM, Sonam Nepali wrote:
> Hi
>
> I am using local-transport within the VM to host my service and execute my client.  This time I generated the java stubs from the WSDL using CXF's wsdl2java tool.  When I run the client I still see the same error.  The one way method runs fine however the twoway methods fail.  The following is the error when running the hello() method, a twoway method:
>
> --------------------------------------
> Feb 22, 2011 3:18:03 PM org.apache.cxf.interceptor.LoggingInInterceptor logging
> INFO: Inbound Message
> ----------------------------
> ID: 1
> Encoding: UTF-8
> Content-Type: text/xml
> Headers: {SOAPAction=[""]}
> Payload:<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:hello xmlns:ns2="http://services.sample.services.ihc.org/"/></soap:Body></soap:Envelope>
> --------------------------------------
> Feb 22, 2011 3:18:03 PM org.apache.cxf.phase.PhaseInterceptorChain doIntercept
> WARNING: Interceptor has thrown exception, unwinding now
> org.apache.cxf.interceptor.Fault: Message part {http://services.sample.services.ihc.org/}hello was not recognized.  (Does it exist in service WSDL?)
> 	at org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(DocLiteralInInterceptor.java:184)
> 	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
> 	at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:104)
>
>
>
>
> Since I am testing in a local transport, I generated the WSDL using maven plugin.  This wsdl has 3 methods: 2 of them are two-way methods and one of them is oneway method.  Is there something I am missing?
>
> thanks
>
> Sonam Nepali
>
> ---------------------------------------------------------------------------------------
> ---------------------------------------------------------------------------------------
>
> -----Original Message-----
> From: Glen Mazza [mailto:gmazza@talend.com]
> Sent: Tuesday, February 22, 2011 2:19 PM
> To: users@cxf.apache.org
> Subject: Re: wsdl converted to java and calling using Cxf client not working
>
> The fact that you're using Metro's wsimport instead of CXF's wsdl2java,
> and that one of the operations work, may both be distractions from the
> actual problem.  (You can always check by generating your client with
> CXF's wsdl2java[1] to confirm the same error would occur.)  One
> possibility is that the WSDL used by the web service provider is somehow
> different from the one you used to generate the client, and hence
> "{http://services.sample.services.ihc.org/}hello" doesn't exist in the
> service WSDL, just like the error message says.  Adding "?wsdl" to the
> endpoint address and viewing the resulting URL in the browser will give
> you the precise WSDL used by the web service provider.
>
> HTH,
> Glen
>
> [1] http://www.jroller.com/gmazza/entry/soap_client_tutorial
>
> On 2/22/2011 4:00 PM, Sonam Nepali wrote:
>> Hi
>>
>> I have converted a wsdl to java using Metro webstack framework tool and using CXF client to invoke the services.
>>
>> I have two methods in this generated java class: first one is  a oneway method and the other a request-response method.
>> I am able to get the oneway method to work but the requeset-response method fails upon invocation.  The following is the error:
>>
>> Feb 22, 2011 1:56:48 PM org.apache.cxf.interceptor.LoggingInInterceptor logging
>> INFO: Inbound Message
>> ----------------------------
>> ID: 1
>> Encoding: UTF-8
>> Content-Type: text/xml
>> Headers: {SOAPAction=[""]}
>> Payload:<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:hello xmlns:ns2="http://services.sample.services.ihc.org/"/></soap:Body></soap:Envelope>
>> --------------------------------------
>> Feb 22, 2011 1:56:48 PM org.apache.cxf.phase.PhaseInterceptorChain doIntercept
>> WARNING: Interceptor has thrown exception, unwinding now
>> org.apache.cxf.interceptor.Fault: Message part {http://services.sample.services.ihc.org/}hello was not recognized.  (Does it exist in service WSDL?)
>>         at org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(DocLiteralInInterceptor.java:184)
>>         at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
>>         at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:104)
>>         at org.apache.cxf.transport.local.LocalConduit$1$1.run(LocalConduit.java:132)
>>         at java.lang.Thread.run(Unknown Source)
>> Feb 22, 2011 1:56:48 PM org.apache.cxf.interceptor.LoggingOutInterceptor$LoggingCallback onClose
>>
>>
>> Any thoughts on why my two way method fails?
>>
>> Thanks
>>
>> Sonam Nepali
>



RE: wsdl converted to java and calling using Cxf client not working

Posted by Sonam Nepali <So...@imail.org>.
Sorry but I think I know what my problem is.  

thanks

-----Original Message-----
From: Sonam Nepali [mailto:Sonam.Nepali@imail.org] 
Sent: Wednesday, February 23, 2011 9:51 AM
To: Daniel Kulp; users@cxf.apache.org
Subject: RE: wsdl converted to java and calling using Cxf client not working

Sorry, I don't know how to attach to a JIRA.  I went to http://issues.apache.org/jira/browse/CXF but don't know what I need to do next.
 I have attached the zip file here.  There is a test case that goes along with it. 

Thanks

Sonam Nepali

-----Original Message-----
From: Daniel Kulp [mailto:dkulp@apache.org] 
Sent: Wednesday, February 23, 2011 8:33 AM
To: users@cxf.apache.org
Cc: Sonam Nepali
Subject: Re: wsdl converted to java and calling using Cxf client not working


Any chance you can package that up as a testcase and attach it to a JIRA?   
I'm not sure what would cause that.  :-(


Dan



On Tuesday 22 February 2011 5:32:26 PM Sonam Nepali wrote:
> Hi
> 
> I am using local-transport within the VM to host my service and execute my
> client.  This time I generated the java stubs from the WSDL using CXF's
> wsdl2java tool.  When I run the client I still see the same error.  The
> one way method runs fine however the twoway methods fail.  The following
> is the error when running the hello() method, a twoway method:
> 
> --------------------------------------
> Feb 22, 2011 3:18:03 PM org.apache.cxf.interceptor.LoggingInInterceptor
> logging INFO: Inbound Message
> ----------------------------
> ID: 1
> Encoding: UTF-8
> Content-Type: text/xml
> Headers: {SOAPAction=[""]}
> Payload: <soap:Envelope
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:hel
> lo
> xmlns:ns2="http://services.sample.services.ihc.org/"/></soap:Body></soap:E
> nvelope> --------------------------------------
> Feb 22, 2011 3:18:03 PM org.apache.cxf.phase.PhaseInterceptorChain
> doIntercept WARNING: Interceptor has thrown exception, unwinding now
> org.apache.cxf.interceptor.Fault: Message part
> {http://services.sample.services.ihc.org/}hello was not recognized.  (Does
> it exist in service WSDL?) at
> org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(DocLitera
> lInInterceptor.java:184) at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorCha
> in.java:236) at
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiation
> Observer.java:104)
> 
> 
> 
> 
> Since I am testing in a local transport, I generated the WSDL using maven
> plugin.  This wsdl has 3 methods: 2 of them are two-way methods and one of
> them is oneway method.  Is there something I am missing?
> 
> thanks
> 
> Sonam Nepali
> 
> ---------------------------------------------------------------------------
> ------------
> --------------------------------------------------------------------------
> -------------
> 
> -----Original Message-----
> From: Glen Mazza [mailto:gmazza@talend.com]
> Sent: Tuesday, February 22, 2011 2:19 PM
> To: users@cxf.apache.org
> Subject: Re: wsdl converted to java and calling using Cxf client not
> working
> 
> The fact that you're using Metro's wsimport instead of CXF's wsdl2java,
> and that one of the operations work, may both be distractions from the
> actual problem.  (You can always check by generating your client with
> CXF's wsdl2java[1] to confirm the same error would occur.)  One
> possibility is that the WSDL used by the web service provider is somehow
> different from the one you used to generate the client, and hence
> "{http://services.sample.services.ihc.org/}hello" doesn't exist in the
> service WSDL, just like the error message says.  Adding "?wsdl" to the
> endpoint address and viewing the resulting URL in the browser will give
> you the precise WSDL used by the web service provider.
> 
> HTH,
> Glen
> 
> [1] http://www.jroller.com/gmazza/entry/soap_client_tutorial
> 
> On 2/22/2011 4:00 PM, Sonam Nepali wrote:
> > Hi
> > 
> > I have converted a wsdl to java using Metro webstack framework tool and
> > using CXF client to invoke the services.
> > 
> > I have two methods in this generated java class: first one is  a oneway
> > method and the other a request-response method. I am able to get the
> > oneway method to work but the requeset-response method fails upon
> > invocation.  The following is the error:
> > 
> > Feb 22, 2011 1:56:48 PM org.apache.cxf.interceptor.LoggingInInterceptor
> > logging INFO: Inbound Message
> > ----------------------------
> > ID: 1
> > Encoding: UTF-8
> > Content-Type: text/xml
> > Headers: {SOAPAction=[""]}
> > Payload:<soap:Envelope
> > xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:h
> > ello
> > xmlns:ns2="http://services.sample.services.ihc.org/"/></soap:Body></soap
> > :Envelope> --------------------------------------
> > Feb 22, 2011 1:56:48 PM org.apache.cxf.phase.PhaseInterceptorChain
> > doIntercept WARNING: Interceptor has thrown exception, unwinding now
> > org.apache.cxf.interceptor.Fault: Message part
> > {http://services.sample.services.ihc.org/}hello was not recognized. 
> > (Does it exist in service WSDL?)
> > 
> >        at
> >        org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(
> >        DocLiteralInInterceptor.java:184) at
> >        org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInter
> >        ceptorChain.java:236) at
> >        org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainI
> >        nitiationObserver.java:104) at
> >        org.apache.cxf.transport.local.LocalConduit$1$1.run(LocalConduit.
> >        java:132) at java.lang.Thread.run(Unknown Source)
> > 
> > Feb 22, 2011 1:56:48 PM
> > org.apache.cxf.interceptor.LoggingOutInterceptor$LoggingCallback onClose
> > 
> > 
> > Any thoughts on why my two way method fails?
> > 
> > Thanks
> > 
> > Sonam Nepali

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

Re: wsdl converted to java and calling using Cxf client not working

Posted by Glen Mazza <gm...@talend.com>.
Dan will be out soon today, so probably best to enter it in JIRA.  At 
the page you linked to below, select the Log-In button in the 
upper-right corner and then the Sign Up for an account button on the 
login page.  Once you've signed up and logged in, select Issues -> 
Create Issue from the upper left menu, type in the bug report (linking 
to this email thread: 
http://cxf.547215.n5.nabble.com/wsdl-converted-to-java-and-calling-using-Cxf-client-not-working-td3396163.html) 
and submit it, and then after you submitted it go back to the bug and 
upload your attachment (there will be a side menu option for that).

Glen

On 2/23/2011 11:51 AM, Sonam Nepali wrote:
> Sorry, I don't know how to attach to a JIRA.  I went to http://issues.apache.org/jira/browse/CXF but don't know what I need to do next.
>   I have attached the zip file here.  There is a test case that goes along with it.
>
> Thanks
>
> Sonam Nepali
>
> -----Original Message-----
> From: Daniel Kulp [mailto:dkulp@apache.org]
> Sent: Wednesday, February 23, 2011 8:33 AM
> To: users@cxf.apache.org
> Cc: Sonam Nepali
> Subject: Re: wsdl converted to java and calling using Cxf client not working
>
>
> Any chance you can package that up as a testcase and attach it to a JIRA?
> I'm not sure what would cause that.  :-(
>
>
> Dan
>
>
>
> On Tuesday 22 February 2011 5:32:26 PM Sonam Nepali wrote:
>> Hi
>>
>> I am using local-transport within the VM to host my service and execute my
>> client.  This time I generated the java stubs from the WSDL using CXF's
>> wsdl2java tool.  When I run the client I still see the same error.  The
>> one way method runs fine however the twoway methods fail.  The following
>> is the error when running the hello() method, a twoway method:
>>
>> --------------------------------------
>> Feb 22, 2011 3:18:03 PM org.apache.cxf.interceptor.LoggingInInterceptor
>> logging INFO: Inbound Message
>> ----------------------------
>> ID: 1
>> Encoding: UTF-8
>> Content-Type: text/xml
>> Headers: {SOAPAction=[""]}
>> Payload:<soap:Envelope
>> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:hel
>> lo
>> xmlns:ns2="http://services.sample.services.ihc.org/"/></soap:Body></soap:E
>> nvelope>  --------------------------------------
>> Feb 22, 2011 3:18:03 PM org.apache.cxf.phase.PhaseInterceptorChain
>> doIntercept WARNING: Interceptor has thrown exception, unwinding now
>> org.apache.cxf.interceptor.Fault: Message part
>> {http://services.sample.services.ihc.org/}hello was not recognized.  (Does
>> it exist in service WSDL?) at
>> org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(DocLitera
>> lInInterceptor.java:184) at
>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorCha
>> in.java:236) at
>> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiation
>> Observer.java:104)
>>
>>
>>
>>
>> Since I am testing in a local transport, I generated the WSDL using maven
>> plugin.  This wsdl has 3 methods: 2 of them are two-way methods and one of
>> them is oneway method.  Is there something I am missing?
>>
>> thanks
>>
>> Sonam Nepali
>>
>> ---------------------------------------------------------------------------
>> ------------
>> --------------------------------------------------------------------------
>> -------------
>>
>> -----Original Message-----
>> From: Glen Mazza [mailto:gmazza@talend.com]
>> Sent: Tuesday, February 22, 2011 2:19 PM
>> To: users@cxf.apache.org
>> Subject: Re: wsdl converted to java and calling using Cxf client not
>> working
>>
>> The fact that you're using Metro's wsimport instead of CXF's wsdl2java,
>> and that one of the operations work, may both be distractions from the
>> actual problem.  (You can always check by generating your client with
>> CXF's wsdl2java[1] to confirm the same error would occur.)  One
>> possibility is that the WSDL used by the web service provider is somehow
>> different from the one you used to generate the client, and hence
>> "{http://services.sample.services.ihc.org/}hello" doesn't exist in the
>> service WSDL, just like the error message says.  Adding "?wsdl" to the
>> endpoint address and viewing the resulting URL in the browser will give
>> you the precise WSDL used by the web service provider.
>>
>> HTH,
>> Glen
>>
>> [1] http://www.jroller.com/gmazza/entry/soap_client_tutorial
>>
>> On 2/22/2011 4:00 PM, Sonam Nepali wrote:
>>> Hi
>>>
>>> I have converted a wsdl to java using Metro webstack framework tool and
>>> using CXF client to invoke the services.
>>>
>>> I have two methods in this generated java class: first one is  a oneway
>>> method and the other a request-response method. I am able to get the
>>> oneway method to work but the requeset-response method fails upon
>>> invocation.  The following is the error:
>>>
>>> Feb 22, 2011 1:56:48 PM org.apache.cxf.interceptor.LoggingInInterceptor
>>> logging INFO: Inbound Message
>>> ----------------------------
>>> ID: 1
>>> Encoding: UTF-8
>>> Content-Type: text/xml
>>> Headers: {SOAPAction=[""]}
>>> Payload:<soap:Envelope
>>> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:h
>>> ello
>>> xmlns:ns2="http://services.sample.services.ihc.org/"/></soap:Body></soap
>>> :Envelope>  --------------------------------------
>>> Feb 22, 2011 1:56:48 PM org.apache.cxf.phase.PhaseInterceptorChain
>>> doIntercept WARNING: Interceptor has thrown exception, unwinding now
>>> org.apache.cxf.interceptor.Fault: Message part
>>> {http://services.sample.services.ihc.org/}hello was not recognized.
>>> (Does it exist in service WSDL?)
>>>
>>>         at
>>>         org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(
>>>         DocLiteralInInterceptor.java:184) at
>>>         org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInter
>>>         ceptorChain.java:236) at
>>>         org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainI
>>>         nitiationObserver.java:104) at
>>>         org.apache.cxf.transport.local.LocalConduit$1$1.run(LocalConduit.
>>>         java:132) at java.lang.Thread.run(Unknown Source)
>>>
>>> Feb 22, 2011 1:56:48 PM
>>> org.apache.cxf.interceptor.LoggingOutInterceptor$LoggingCallback onClose
>>>
>>>
>>> Any thoughts on why my two way method fails?
>>>
>>> Thanks
>>>
>>> Sonam Nepali



RE: wsdl converted to java and calling using Cxf client not working

Posted by Sonam Nepali <So...@imail.org>.
Sorry, I don't know how to attach to a JIRA.  I went to http://issues.apache.org/jira/browse/CXF but don't know what I need to do next.
 I have attached the zip file here.  There is a test case that goes along with it. 

Thanks

Sonam Nepali

-----Original Message-----
From: Daniel Kulp [mailto:dkulp@apache.org] 
Sent: Wednesday, February 23, 2011 8:33 AM
To: users@cxf.apache.org
Cc: Sonam Nepali
Subject: Re: wsdl converted to java and calling using Cxf client not working


Any chance you can package that up as a testcase and attach it to a JIRA?   
I'm not sure what would cause that.  :-(


Dan



On Tuesday 22 February 2011 5:32:26 PM Sonam Nepali wrote:
> Hi
> 
> I am using local-transport within the VM to host my service and execute my
> client.  This time I generated the java stubs from the WSDL using CXF's
> wsdl2java tool.  When I run the client I still see the same error.  The
> one way method runs fine however the twoway methods fail.  The following
> is the error when running the hello() method, a twoway method:
> 
> --------------------------------------
> Feb 22, 2011 3:18:03 PM org.apache.cxf.interceptor.LoggingInInterceptor
> logging INFO: Inbound Message
> ----------------------------
> ID: 1
> Encoding: UTF-8
> Content-Type: text/xml
> Headers: {SOAPAction=[""]}
> Payload: <soap:Envelope
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:hel
> lo
> xmlns:ns2="http://services.sample.services.ihc.org/"/></soap:Body></soap:E
> nvelope> --------------------------------------
> Feb 22, 2011 3:18:03 PM org.apache.cxf.phase.PhaseInterceptorChain
> doIntercept WARNING: Interceptor has thrown exception, unwinding now
> org.apache.cxf.interceptor.Fault: Message part
> {http://services.sample.services.ihc.org/}hello was not recognized.  (Does
> it exist in service WSDL?) at
> org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(DocLitera
> lInInterceptor.java:184) at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorCha
> in.java:236) at
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiation
> Observer.java:104)
> 
> 
> 
> 
> Since I am testing in a local transport, I generated the WSDL using maven
> plugin.  This wsdl has 3 methods: 2 of them are two-way methods and one of
> them is oneway method.  Is there something I am missing?
> 
> thanks
> 
> Sonam Nepali
> 
> ---------------------------------------------------------------------------
> ------------
> --------------------------------------------------------------------------
> -------------
> 
> -----Original Message-----
> From: Glen Mazza [mailto:gmazza@talend.com]
> Sent: Tuesday, February 22, 2011 2:19 PM
> To: users@cxf.apache.org
> Subject: Re: wsdl converted to java and calling using Cxf client not
> working
> 
> The fact that you're using Metro's wsimport instead of CXF's wsdl2java,
> and that one of the operations work, may both be distractions from the
> actual problem.  (You can always check by generating your client with
> CXF's wsdl2java[1] to confirm the same error would occur.)  One
> possibility is that the WSDL used by the web service provider is somehow
> different from the one you used to generate the client, and hence
> "{http://services.sample.services.ihc.org/}hello" doesn't exist in the
> service WSDL, just like the error message says.  Adding "?wsdl" to the
> endpoint address and viewing the resulting URL in the browser will give
> you the precise WSDL used by the web service provider.
> 
> HTH,
> Glen
> 
> [1] http://www.jroller.com/gmazza/entry/soap_client_tutorial
> 
> On 2/22/2011 4:00 PM, Sonam Nepali wrote:
> > Hi
> > 
> > I have converted a wsdl to java using Metro webstack framework tool and
> > using CXF client to invoke the services.
> > 
> > I have two methods in this generated java class: first one is  a oneway
> > method and the other a request-response method. I am able to get the
> > oneway method to work but the requeset-response method fails upon
> > invocation.  The following is the error:
> > 
> > Feb 22, 2011 1:56:48 PM org.apache.cxf.interceptor.LoggingInInterceptor
> > logging INFO: Inbound Message
> > ----------------------------
> > ID: 1
> > Encoding: UTF-8
> > Content-Type: text/xml
> > Headers: {SOAPAction=[""]}
> > Payload:<soap:Envelope
> > xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:h
> > ello
> > xmlns:ns2="http://services.sample.services.ihc.org/"/></soap:Body></soap
> > :Envelope> --------------------------------------
> > Feb 22, 2011 1:56:48 PM org.apache.cxf.phase.PhaseInterceptorChain
> > doIntercept WARNING: Interceptor has thrown exception, unwinding now
> > org.apache.cxf.interceptor.Fault: Message part
> > {http://services.sample.services.ihc.org/}hello was not recognized. 
> > (Does it exist in service WSDL?)
> > 
> >        at
> >        org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(
> >        DocLiteralInInterceptor.java:184) at
> >        org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInter
> >        ceptorChain.java:236) at
> >        org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainI
> >        nitiationObserver.java:104) at
> >        org.apache.cxf.transport.local.LocalConduit$1$1.run(LocalConduit.
> >        java:132) at java.lang.Thread.run(Unknown Source)
> > 
> > Feb 22, 2011 1:56:48 PM
> > org.apache.cxf.interceptor.LoggingOutInterceptor$LoggingCallback onClose
> > 
> > 
> > Any thoughts on why my two way method fails?
> > 
> > Thanks
> > 
> > Sonam Nepali

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

Re: wsdl converted to java and calling using Cxf client not working

Posted by Daniel Kulp <dk...@apache.org>.
Any chance you can package that up as a testcase and attach it to a JIRA?   
I'm not sure what would cause that.  :-(


Dan



On Tuesday 22 February 2011 5:32:26 PM Sonam Nepali wrote:
> Hi
> 
> I am using local-transport within the VM to host my service and execute my
> client.  This time I generated the java stubs from the WSDL using CXF's
> wsdl2java tool.  When I run the client I still see the same error.  The
> one way method runs fine however the twoway methods fail.  The following
> is the error when running the hello() method, a twoway method:
> 
> --------------------------------------
> Feb 22, 2011 3:18:03 PM org.apache.cxf.interceptor.LoggingInInterceptor
> logging INFO: Inbound Message
> ----------------------------
> ID: 1
> Encoding: UTF-8
> Content-Type: text/xml
> Headers: {SOAPAction=[""]}
> Payload: <soap:Envelope
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:hel
> lo
> xmlns:ns2="http://services.sample.services.ihc.org/"/></soap:Body></soap:E
> nvelope> --------------------------------------
> Feb 22, 2011 3:18:03 PM org.apache.cxf.phase.PhaseInterceptorChain
> doIntercept WARNING: Interceptor has thrown exception, unwinding now
> org.apache.cxf.interceptor.Fault: Message part
> {http://services.sample.services.ihc.org/}hello was not recognized.  (Does
> it exist in service WSDL?) at
> org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(DocLitera
> lInInterceptor.java:184) at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorCha
> in.java:236) at
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiation
> Observer.java:104)
> 
> 
> 
> 
> Since I am testing in a local transport, I generated the WSDL using maven
> plugin.  This wsdl has 3 methods: 2 of them are two-way methods and one of
> them is oneway method.  Is there something I am missing?
> 
> thanks
> 
> Sonam Nepali
> 
> ---------------------------------------------------------------------------
> ------------
> --------------------------------------------------------------------------
> -------------
> 
> -----Original Message-----
> From: Glen Mazza [mailto:gmazza@talend.com]
> Sent: Tuesday, February 22, 2011 2:19 PM
> To: users@cxf.apache.org
> Subject: Re: wsdl converted to java and calling using Cxf client not
> working
> 
> The fact that you're using Metro's wsimport instead of CXF's wsdl2java,
> and that one of the operations work, may both be distractions from the
> actual problem.  (You can always check by generating your client with
> CXF's wsdl2java[1] to confirm the same error would occur.)  One
> possibility is that the WSDL used by the web service provider is somehow
> different from the one you used to generate the client, and hence
> "{http://services.sample.services.ihc.org/}hello" doesn't exist in the
> service WSDL, just like the error message says.  Adding "?wsdl" to the
> endpoint address and viewing the resulting URL in the browser will give
> you the precise WSDL used by the web service provider.
> 
> HTH,
> Glen
> 
> [1] http://www.jroller.com/gmazza/entry/soap_client_tutorial
> 
> On 2/22/2011 4:00 PM, Sonam Nepali wrote:
> > Hi
> > 
> > I have converted a wsdl to java using Metro webstack framework tool and
> > using CXF client to invoke the services.
> > 
> > I have two methods in this generated java class: first one is  a oneway
> > method and the other a request-response method. I am able to get the
> > oneway method to work but the requeset-response method fails upon
> > invocation.  The following is the error:
> > 
> > Feb 22, 2011 1:56:48 PM org.apache.cxf.interceptor.LoggingInInterceptor
> > logging INFO: Inbound Message
> > ----------------------------
> > ID: 1
> > Encoding: UTF-8
> > Content-Type: text/xml
> > Headers: {SOAPAction=[""]}
> > Payload:<soap:Envelope
> > xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:h
> > ello
> > xmlns:ns2="http://services.sample.services.ihc.org/"/></soap:Body></soap
> > :Envelope> --------------------------------------
> > Feb 22, 2011 1:56:48 PM org.apache.cxf.phase.PhaseInterceptorChain
> > doIntercept WARNING: Interceptor has thrown exception, unwinding now
> > org.apache.cxf.interceptor.Fault: Message part
> > {http://services.sample.services.ihc.org/}hello was not recognized. 
> > (Does it exist in service WSDL?)
> > 
> >        at
> >        org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(
> >        DocLiteralInInterceptor.java:184) at
> >        org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInter
> >        ceptorChain.java:236) at
> >        org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainI
> >        nitiationObserver.java:104) at
> >        org.apache.cxf.transport.local.LocalConduit$1$1.run(LocalConduit.
> >        java:132) at java.lang.Thread.run(Unknown Source)
> > 
> > Feb 22, 2011 1:56:48 PM
> > org.apache.cxf.interceptor.LoggingOutInterceptor$LoggingCallback onClose
> > 
> > 
> > Any thoughts on why my two way method fails?
> > 
> > Thanks
> > 
> > Sonam Nepali

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

RE: wsdl converted to java and calling using Cxf client not working

Posted by Sonam Nepali <So...@imail.org>.
Hi 

I am using local-transport within the VM to host my service and execute my client.  This time I generated the java stubs from the WSDL using CXF's wsdl2java tool.  When I run the client I still see the same error.  The one way method runs fine however the twoway methods fail.  The following is the error when running the hello() method, a twoway method:

--------------------------------------
Feb 22, 2011 3:18:03 PM org.apache.cxf.interceptor.LoggingInInterceptor logging
INFO: Inbound Message
----------------------------
ID: 1
Encoding: UTF-8
Content-Type: text/xml
Headers: {SOAPAction=[""]}
Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:hello xmlns:ns2="http://services.sample.services.ihc.org/"/></soap:Body></soap:Envelope>
--------------------------------------
Feb 22, 2011 3:18:03 PM org.apache.cxf.phase.PhaseInterceptorChain doIntercept
WARNING: Interceptor has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Message part {http://services.sample.services.ihc.org/}hello was not recognized.  (Does it exist in service WSDL?)
	at org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(DocLiteralInInterceptor.java:184)
	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
	at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:104)




Since I am testing in a local transport, I generated the WSDL using maven plugin.  This wsdl has 3 methods: 2 of them are two-way methods and one of them is oneway method.  Is there something I am missing?

thanks

Sonam Nepali

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

-----Original Message-----
From: Glen Mazza [mailto:gmazza@talend.com] 
Sent: Tuesday, February 22, 2011 2:19 PM
To: users@cxf.apache.org
Subject: Re: wsdl converted to java and calling using Cxf client not working

The fact that you're using Metro's wsimport instead of CXF's wsdl2java, 
and that one of the operations work, may both be distractions from the 
actual problem.  (You can always check by generating your client with 
CXF's wsdl2java[1] to confirm the same error would occur.)  One 
possibility is that the WSDL used by the web service provider is somehow 
different from the one you used to generate the client, and hence 
"{http://services.sample.services.ihc.org/}hello" doesn't exist in the 
service WSDL, just like the error message says.  Adding "?wsdl" to the 
endpoint address and viewing the resulting URL in the browser will give 
you the precise WSDL used by the web service provider.

HTH,
Glen

[1] http://www.jroller.com/gmazza/entry/soap_client_tutorial

On 2/22/2011 4:00 PM, Sonam Nepali wrote:
> Hi
>
> I have converted a wsdl to java using Metro webstack framework tool and using CXF client to invoke the services.
>
> I have two methods in this generated java class: first one is  a oneway method and the other a request-response method.
> I am able to get the oneway method to work but the requeset-response method fails upon invocation.  The following is the error:
>
> Feb 22, 2011 1:56:48 PM org.apache.cxf.interceptor.LoggingInInterceptor logging
> INFO: Inbound Message
> ----------------------------
> ID: 1
> Encoding: UTF-8
> Content-Type: text/xml
> Headers: {SOAPAction=[""]}
> Payload:<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:hello xmlns:ns2="http://services.sample.services.ihc.org/"/></soap:Body></soap:Envelope>
> --------------------------------------
> Feb 22, 2011 1:56:48 PM org.apache.cxf.phase.PhaseInterceptorChain doIntercept
> WARNING: Interceptor has thrown exception, unwinding now
> org.apache.cxf.interceptor.Fault: Message part {http://services.sample.services.ihc.org/}hello was not recognized.  (Does it exist in service WSDL?)
>        at org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(DocLiteralInInterceptor.java:184)
>        at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
>        at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:104)
>        at org.apache.cxf.transport.local.LocalConduit$1$1.run(LocalConduit.java:132)
>        at java.lang.Thread.run(Unknown Source)
> Feb 22, 2011 1:56:48 PM org.apache.cxf.interceptor.LoggingOutInterceptor$LoggingCallback onClose
>
>
> Any thoughts on why my two way method fails?
>
> Thanks
>
> Sonam Nepali



Re: wsdl converted to java and calling using Cxf client not working

Posted by Glen Mazza <gm...@talend.com>.
The fact that you're using Metro's wsimport instead of CXF's wsdl2java, 
and that one of the operations work, may both be distractions from the 
actual problem.  (You can always check by generating your client with 
CXF's wsdl2java[1] to confirm the same error would occur.)  One 
possibility is that the WSDL used by the web service provider is somehow 
different from the one you used to generate the client, and hence 
"{http://services.sample.services.ihc.org/}hello" doesn't exist in the 
service WSDL, just like the error message says.  Adding "?wsdl" to the 
endpoint address and viewing the resulting URL in the browser will give 
you the precise WSDL used by the web service provider.

HTH,
Glen

[1] http://www.jroller.com/gmazza/entry/soap_client_tutorial

On 2/22/2011 4:00 PM, Sonam Nepali wrote:
> Hi
>
> I have converted a wsdl to java using Metro webstack framework tool and using CXF client to invoke the services.
>
> I have two methods in this generated java class: first one is  a oneway method and the other a request-response method.
> I am able to get the oneway method to work but the requeset-response method fails upon invocation.  The following is the error:
>
> Feb 22, 2011 1:56:48 PM org.apache.cxf.interceptor.LoggingInInterceptor logging
> INFO: Inbound Message
> ----------------------------
> ID: 1
> Encoding: UTF-8
> Content-Type: text/xml
> Headers: {SOAPAction=[""]}
> Payload:<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:hello xmlns:ns2="http://services.sample.services.ihc.org/"/></soap:Body></soap:Envelope>
> --------------------------------------
> Feb 22, 2011 1:56:48 PM org.apache.cxf.phase.PhaseInterceptorChain doIntercept
> WARNING: Interceptor has thrown exception, unwinding now
> org.apache.cxf.interceptor.Fault: Message part {http://services.sample.services.ihc.org/}hello was not recognized.  (Does it exist in service WSDL?)
>        at org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(DocLiteralInInterceptor.java:184)
>        at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
>        at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:104)
>        at org.apache.cxf.transport.local.LocalConduit$1$1.run(LocalConduit.java:132)
>        at java.lang.Thread.run(Unknown Source)
> Feb 22, 2011 1:56:48 PM org.apache.cxf.interceptor.LoggingOutInterceptor$LoggingCallback onClose
>
>
> Any thoughts on why my two way method fails?
>
> Thanks
>
> Sonam Nepali