Hello,

I added a defaultMep to the xbean.xml of the HTTP consumer endpoint as such:
<http:endpoint service="person:PersonService2"
                 endpoint="soap"
                 targetService="person:PersonService2"
                 role="consumer" 
                 locationURI="http://0.0.0.0:8192/PersonService2/";
                 soap="true" 
                 defaultMep="http://www.w3.org/2004/08/wsdl/in-out"; />

and I received the following error when executing the client.html:

STATUS: 400
<?xml version='1.0' encoding='UTF-8'?><env:Envelope
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/";><env:Body><env:Fault><faultcode>env:Client</faultcode><faultstring>Invalid
operation:
{http://servicemix.apache.org/samples/wsdl-second/types}GetPersonRequest</faultstring><detail><stack>org.codehaus.xfire.fault.XFireFault:
Invalid operation:
{http://servicemix.apache.org/samples/wsdl-second/types}GetPersonRequest
        at
org.codehaus.xfire.service.binding.WrappedBinding.readMessage(WrappedBinding.java:41)
        at 
org.codehaus.xfire.jaxws.JAXWSBinding.readMessage(JAXWSBinding.java:60)
        at
org.codehaus.xfire.soap.handler.SoapBodyHandler.invoke(SoapBodyHandler.java:42)
        at
org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
        at
org.codehaus.xfire.transport.DefaultEndpoint.onReceive(DefaultEndpoint.java:64)
        at
org.codehaus.xfire.transport.AbstractChannel.receive(AbstractChannel.java:38)
        at
org.apache.servicemix.jsr181.Jsr181ExchangeProcessor.process(Jsr181ExchangeProcessor.java:113)
        at
org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:489)
        at
org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:441)
        at
org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLifeCycle.java:46)
        at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:595)
        at
org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:174)
        at
org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:176)
        at
org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
        at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
        at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
        at java.lang.Thread.run(Thread.java:595)
</stack></detail></env:Fault></env:Body></env:Envelope>

Any ideas??  Thanks.


charliec wrote:
> 
> Hello, 
> 
> After adding the @Webmethod, I received the error below.  Also, how do you
> specify the defaultMep attribute on the HTTP consumer endpoint?  Thanks.
> 
> [ERROR] BUILD ERROR
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Failed to generate jbi.xml
> 
> Embedded error: Unable to generate service unit descriptor!
> <component-task-result
> xmlns="http://java.sun.com/xml/ns/jbi/management-message";
>>
>         <component-name>null</component-name>
>         <component-task-result-details>
>                 <task-result-details>
>                         <task-id>deploy</task-id>
>                         <task-result>FAILED</task-result>
>                         <message-type>ERROR</message-type>
>                        
> <task-status-msg><msg-loc-info><loc-token/><loc-message>
> org.codehaus.xfire.annotations.AnnotationException: @WebMethod attributes
> are on
> ly allowed on the endpointInterface! Offending class:
> org.apache.servicemix.samp
> les.wsdl_second.PersonImpl</loc-message></msg-loc-info></task-status-msg>
>                         <exception-info>
>                                 <nesting-level>1</nesting-level>
>                                 <msg-loc-info>
>                                         <loc-token />
>                                         <loc-message>@WebMethod attributes
> are o
> nly allowed on the endpointInterface! Offending class:
> org.apache.servicemix.sam
> ples.wsdl_second.PersonImpl</loc-message>
>                                        
> <stack-trace><![CDATA[org.codehaus.xfire
> .annotations.AnnotationException: @WebMethod attributes are only allowed
> on the
> endpointInterface! Offending class:
> org.apache.servicemix.samples.wsdl_second.Pe
> rsonImpl
>         at
> org.codehaus.xfire.annotations.AnnotationServiceFactory.assertValidIm
> plementationClass(AnnotationServiceFactory.java:338)
>         at
> org.codehaus.xfire.annotations.AnnotationServiceFactory.create(Annota
> tionServiceFactory.java:175)
>         at
> org.apache.servicemix.jsr181.Jsr181Endpoint.registerService(Jsr181End
> point.java:301)
>         at
> org.apache.servicemix.jsr181.Jsr181Endpoint.validate(Jsr181Endpoint.j
> ava:216)
>         at
> org.apache.servicemix.common.DefaultComponent.addEndpoint(DefaultComp
> onent.java:300)
>         at
> org.apache.servicemix.common.DefaultComponent.doInit(DefaultComponent
> .java:287)
>         at
> org.apache.servicemix.jsr181.Jsr181Component.doInit(Jsr181Component.j
> ava:81)
>         at
> org.apache.servicemix.common.AsyncBaseLifeCycle.init(AsyncBaseLifeCyc
> le.java:142)
>         at
> org.apache.servicemix.jsr181.packaging.Jsr181ServiceUnitAnalyzer.getP
> rovides(Jsr181ServiceUnitAnalyzer.java:57)
>         at
> org.apache.servicemix.common.xbean.AbstractXBeanServiceUnitAnalyzer.i
> nit(AbstractXBeanServiceUnitAnalyzer.java:96)
>         at
> org.apache.servicemix.maven.plugin.jbi.GenerateServiceUnitDescriptorM
> ojo.generateJbiDescriptor(GenerateServiceUnitDescriptorMojo.java:166)
>         at
> org.apache.servicemix.maven.plugin.jbi.GenerateServiceUnitDescriptorM
> ojo.execute(GenerateServiceUnitDescriptorMojo.java:129)
>         at
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
> nManager.java:443)
>         at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
> ultLifecycleExecutor.java:539)
>         at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
> fecycle(DefaultLifecycleExecutor.java:480)
>         at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
> ltLifecycleExecutor.java:459)
>         at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
> dleFailures(DefaultLifecycleExecutor.java:311)
>         at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
> ts(DefaultLifecycleExecutor.java:278)
>         at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
> fecycleExecutor.java:143)
>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:280)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> java:39)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at
> org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>         at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>         at
> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
> 
>         at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> ]]></stack-trace>
>                                 </msg-loc-info>
>                         </exception-info>
>                 </task-result-details>
>         </component-task-result-details>
> </component-task-result>
> [INFO]
> ------------------------------------------------------------------------
> [INFO] For more information, run Maven with the -e switch
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 2 minutes 14 seconds
> [INFO] Finished at: Fri Aug 03 07:40:26 EDT 2007
> [INFO] Final Memory: 20M/39M
> [INFO]
> ------------------------------------------------------------------------
> 
> D:\apache-servicemix-3.1.1-incubating\examples\wsdl-second>
> 
> 
> Gert Vanthienen wrote:
>> 
>> L.S.,
>> 
>> I think you might have to add a @WebMethod annotation to the getPerson() 
>> method.  If a class is annotated with @WebService, all public methods 
>> are part of the SOAP interface and you don't want that for the 
>> setContext() method probably. 
>> 
>> Not sure if it has anything to do with the exception you get though...  
>> That is usually solved by specifying the defaultMep attribute on the 
>> HTTP consumer endpoint.
>> 
>> Gert
>> 
>> charliec wrote:
>>> Hello, 
>>>
>>> I made a copy of the wsdl-first example and renamed it.  I then change
>>> the
>>> PersonImpl class so it can act as a consumer.  I included the following
>>> code:  
>>>
>>> private javax.jbi.component.ComponentContext context;
>>>
>>> public void setContext(javax.jbi.component.ComponentContext context) {
>>>             this.context = context;         
>>>     }
>>>
>>> I also modified the xbean.xml as follows:
>>>
>>>  <jsr181:endpoint >
>>>         <jsr181:pojo>
>>>             <bean
>>> class="org.apache.servicemix.samples.wsdl_second.PersonImpl">
>>>                 <property name="context" ref="context" />
>>>             </bean>
>>>         </jsr181:pojo>
>>>     </jsr181:endpoint>
>>>
>>> When I execute the client.html, I receive the following error:
>>>
>>> STATUS: 500
>>> <?xml version='1.0' encoding='UTF-8'?><env:Envelope
>>> xmlns:env="http://schemas.xmlsoap.org/soap/envelope/";><env:Body><env:Fault><faultcode>env:Server</faultcode><faultstring>javax.jbi.messaging.MessagingException:
>>> Do not understand pattern:
>>> null</faultstring></env:Fault></env:Body></env:Envelope>
>>>
>>> When I remove the context code from the Java class and xbean.xml file,
>>> it
>>> works fine.  Please help.  I've attached the source code.  Thanks.
>>> http://www.nabble.com/file/p11972224/wsdl-second-3.1.1-incubating-src.zip
>>> wsdl-second-3.1.1-incubating-src.zip 
>>>   
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Error-when-using-javax.jbi.component.ComponentContext-tf4208610s12049.html#a11982779
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to