You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by laolong <le...@sina.com> on 2009/06/10 16:48:51 UTC

How to invoke EJB and How to disable WSDL validation in http:soap-consumer/provider?

Hi

   I'm a newcomer of servicemix, I'm going to make a EJB proxy to expose my
EJB as webservice, but always get 'Cound not find port LoginServicePort in
wsdl for service {http://demo/servicemix}LoginService' error since
loginservice.wsdl is a 'fake' WSDL , looks like validateWsdl="false" is not
working, how can I disable it?

  My code is created according to ServiceMix Tutorials ---Using EJB inside
ServiceMix(http://cwiki.apache.org/SM/6-intermediate-using-ejb-inside-servicemix.html)

  It will be great help to provide a working example of EJB proxy, thanks in
advance!

ejb-http-su xbean.xml
<beans xmlns:http="http://servicemix.apache.org/http/1.0"
       xmlns:tns="http://demo/servicemix">
<http:soap-consumer
		service="tns:LoginService"
		endpoint="ep"
		targetService="tns:LoginService"
		targetEndpoint="LoginServicePort"
		defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
		locationURI="http://0.0.0.0:8199/LoginServiceService"
		wsdl="classpath:loginservice.wsdl"
		validateWsdl="false"
		useJbiWrapper="true"
  />
</beans>


cxfse xbean.xml
<beans xmlns:cxfse="http://servicemix.apache.org/cxfse/1.0"
       xmlns:tns="http://demo/servicemix">

   <bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
      <property name="environment">
         <props>
            <prop key="java.naming.factory.initial">
               weblogic.jndi.WLInitialContextFactory
            </prop>
            <prop key="java.naming.provider.url">
               t3://192.168.80.111:7001
            </prop>
         </props>
      </property>
   </bean>

   <bean id="ejbProxy"
class="org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean">
      <property name="jndiName" value="demo/UserDAORemote"/>
      <property name="businessInterface" value="demo.UserDAORemote"/>
      <property name="homeInterface" value="demo.UserDAORemoteHome"/>
      <property name="refreshHomeOnConnectFailure" value="true"/>
      <property name="cacheHome" value="true"/>
      <property name="lookupHomeOnStartup" value="false"/>
      <property name="resourceRef" value="true"/>
      <property name="jndiTemplate" ref="jndiTemplate"/>
   </bean>

   <cxfse:endpoint>
      <cxfse:pojo>
         <bean class="demo.LoginServiceImpl">
            <property name="proxy" ref="ejbProxy"/>
         </bean>
      </cxfse:pojo>
   </cxfse:endpoint>

</beans>
-- 
View this message in context: http://www.nabble.com/How-to-invoke-EJB-and-How-to-disable-WSDL-validation-in-http%3Asoap-consumer-provider--tp23963883p23963883.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: How to invoke EJB and How to disable WSDL validation in http:soap-consumer/provider?

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Yes, I will.

Regards
JB

laolong wrote:
>  Hi JB,
>     
>      http://www.nabble.com/file/p23978791/demo.zip demo.zip 
> 
>     I built a test EJB but got same error again, all java code and bean
> defination are in attached, could you please review it?
>     
>     I'm sorry that cannot find a way to send email with attachement to you
> alone, so I have to use 'Reply' page to upload the file.
> 
>    Thanks a lot.
> 
> Long  
> 
> 
> Hummm, weird.
> 
> Could you provide the annotate in the your LoginService class (and the 
> corresponding interface) ?
> It looks like that the CXF-SE side is not deployed correctly (and so the 
> HTTP component can't find it).
> Have you all EJB proxy requirements present in your SU zip (EJBs stub, 
> etc) ?
> Is it possible to provide your cxf-se zip file (only to my, not on the 
> mailing list) ?
> 
> Regards
> JB

Re: How to invoke EJB and How to disable WSDL validation in http:soap-consumer/provider?

Posted by laolong <le...@sina.com>.
Hi JB,

   weblogic.jar was in the su package, I removed it since it's too large to
send by email.
   I did test the ejbproxy bean without servicemix, it works well, so I
think there is no problem on weblogic JNDI lookup. The cxf-se WSDL can be
loaded correctly in jmx console even though there is message "Unable to
inject ComponentContext :demo.LoginServiceImpl.setContext"
   sa deployment log as below
NFO  - ServiceAssemblyLifeCycle       - Starting service assembly: ejb-sa
INFO  - ServiceUnitLifeCycle           - Initializing service unit:
ejb-cxf-su
DEBUG - CxfSeComponent                 - Initializing service unit
DEBUG - ComponentContextImpl           - Component: servicemix-cxf-se
activated endpoint: {http://demo/servicemix}LoginServiceService :
LoginServicePort
DEBUG - CxfSeComponent                 - Querying service description for
ServiceEndpoint[service={http://demo/servicemix}LoginServiceService,endpoint=LoginServicePort]
DEBUG - CxfSeComponent                 - No description found for
{http://demo/servicemix}LoginServiceService:LoginServicePort
DEBUG - WSDL1Processor                 - Endpoint
ServiceEndpoint[service={http://demo/servicemix}LoginServiceService,endpoint=LoginServicePort]
has no service description
DEBUG - CxfSeComponent                 - Querying service description for
ServiceEndpoint[service={http://demo/servicemix}LoginServiceService,endpoint=LoginServicePort]
DEBUG - CxfSeComponent                 - No description found for
{http://demo/servicemix}LoginServiceService:LoginServicePort
DEBUG - WSDL2Processor                 - Endpoint
ServiceEndpoint[service={http://demo/servicemix}LoginServiceService,endpoint=LoginServicePort]
has no service description
DEBUG - CxfSeComponent                 - Service unit initialized
INFO  - ServiceUnitLifeCycle           - Initializing service unit:
ejb-http-su
DEBUG - HttpComponent                  - Initializing service unit
DEBUG - JCAFlow                        - ServiceMix: broadcasting info for
org.apache.servicemix.jbi.event.EndpointEvent[source=ServiceEndpoint[service={http://demo/servicemix}LoginServiceService,endpoint=LoginServicePort]]
DEBUG - JMSFlow                        - ServiceMix: broadcasting info for
org.apache.servicemix.jbi.event.EndpointEvent[source=ServiceEndpoint[service={http://demo/servicemix}LoginServiceService,endpoint=LoginServicePort]]
INFO  - jetty                          - jetty-6.1.14
DEBUG - JettyContextManager            - Dispatching job:
org.mortbay.jetty.AbstractConnector$Acceptor@d66725
INFO  - jetty                          - Started
SelectChannelConnector@0.0.0.0:8199
DEBUG - HttpComponent                  - Service unit initialized
INFO  - ServiceUnitLifeCycle           - Starting service unit: ejb-cxf-su
DEBUG - CxfSeComponent                 - Starting service unit
2009-6-12 9:21:43
org.apache.cxf.service.factory.ReflectionServiceFactoryBean
buildServiceFromClass
信息: Creating Service {http://demo/servicemix}LoginServiceService from class
demo.LoginService
2009-6-12 9:21:45 org.apache.cxf.configuration.spring.ConfigurerImpl
getBeanName
信息: Could not determine bean name for instance of class
org.apache.cxf.transport.jbi.JBIDestination.
2009-6-12 9:21:45 org.apache.cxf.endpoint.ServerImpl initDestination
信息: Setting the server's publish address to be
jbi://ID-192-168-83-151-121d2075a0f-25-0
DEBUG - CxfSeComponent                 - Unable to inject ComponentContext:
demo.LoginServiceImpl.setContext(javax.jbi.component.ComponentContext)
DEBUG - CxfSeComponent                 - Service unit started
INFO  - ServiceUnitLifeCycle           - Starting service unit: ejb-http-su
DEBUG - HttpComponent                  - Starting service unit
DEBUG - HttpComponent                  - Service unit started
INFO  - AutoDeploymentService          - Directory: hotdeploy: Finished
installation of archive:  ejb-sa-1.0-SNAPSHOT.jar

Thanks,
Long


Jean-Baptiste Onofré wrote:
> 
> Hi Long,
> 
> In your CXF-SE xbean.xml, I see that you try to make the JNDI lookup on 
> a Weblogic application server.
> 
> Nevertheless, I can't see the weblogic.jar file into your SU lib
> directory.
> 
> To be able to make JNDI lookup and RMI-IIOP, you need the weblogic 
> client lib.
> 
> In your pom.xml, you should have a dependency like this:
> 
> <dependency>
>    <groupId>com.oracle.weblogic</groupId>
>    <artifactId>server</artifactId>
>    <version>10.3</version>
> </dependency>
> 
> You can install the weblogic.jar into your maven working copy using:
> mvn install:install-file -DgroupId=com.oracle.weblogic 
> -DartifactId=server -Dfile=$WLS_HOME/server/lib/weblogic.jar 
> -Dversion=10.3 -Dpackaging=jar
> 
> Could you make a try adding the weblogic.jar into the SU ?
> 
> Regards
> JB
> 
> laolong wrote:
>>  Hi JB,
>>     
>>      http://www.nabble.com/file/p23978791/demo.zip demo.zip 
>> 
>>     I built a test EJB but got same error again, all java code and bean
>> defination are in attached, could you please review it?
>>     
>>     I'm sorry that cannot find a way to send email with attachement to
>> you
>> alone, so I have to use 'Reply' page to upload the file.
>> 
>>    Thanks a lot.
>> 
>> Long  
>> 
>> 
>> Hummm, weird.
>> 
>> Could you provide the annotate in the your LoginService class (and the 
>> corresponding interface) ?
>> It looks like that the CXF-SE side is not deployed correctly (and so the 
>> HTTP component can't find it).
>> Have you all EJB proxy requirements present in your SU zip (EJBs stub, 
>> etc) ?
>> Is it possible to provide your cxf-se zip file (only to my, not on the 
>> mailing list) ?
>> 
>> Regards
>> JB
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-invoke-EJB-and-How-to-disable-WSDL-validation-in-http%3Asoap-consumer-provider--tp23963883p23991505.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: How to invoke EJB and How to disable WSDL validation in http:soap-consumer/provider?

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi again Long,

This log has been generated with which version of the HTTP component ?

Regards
JB

laolong wrote:
>  I guess the problem also caused by Http/Jetty issue, the request message
> cannot be processed, message content is lost due to the SOAP message POST by
> XMLSpy is received with wrong method 'GET'
> 
> SMX log---------------------------------------------
> 
> DEBUG - HttpComponent                  - Receiving HTTP request: GET
> /LoginServiceService/main.wsdl HTTP/1.1
> Accept: */*
> User-Agent: XML Spy
> Host: bjc-d-xp:8199
> Connection: Keep-Alive
> Cache-Control: no-cache
> 
> 
> DEBUG - JettyContextManager            - Dispatching job:
> SCEP@10234051[d=true,io=0,w=true,b=false|false]
> DEBUG - JettyContextManager            - Dispatching job:
> SCEP@10234051[d=true,io=1,w=true,b=false|false]
> DEBUG - JettyContextManager            - Dispatching job:
> SCEP@10234051[d=true,io=1,w=true,b=false|false]
> DEBUG - HttpComponent                  - Receiving HTTP request: GET
> /LoginServiceService/ HTTP/1.1
> User-Agent: XML Spy
> SOAPAction: "urn:Login"
> Host: localhost:8199
> Connection: Keep-Alive
> Cache-Control: no-cache
> 
> 
> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
> interceptor
> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor
> INFO  - PhaseInterceptorChain          - Interceptor has thrown exception,
> unwinding now
> java.lang.NullPointerException: InputStream content not found
> 	at
> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor.handleMessage(AttachmentsInInterceptor.java:46)
> 	at
> org.apache.servicemix.soap.core.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:85)
> 	at
> org.apache.servicemix.http.endpoints.HttpSoapConsumerMarshaler.createExchange(HttpSoapConsumerMarshaler.java:107)
> 	at
> org.apache.servicemix.http.endpoints.HttpConsumerEndpoint.createExchange(HttpConsumerEndpoint.java:488)
> 	at
> org.apache.servicemix.http.endpoints.HttpConsumerEndpoint.process(HttpConsumerEndpoint.java:293)
> 	at
> org.apache.servicemix.http.HttpBridgeServlet.service(HttpBridgeServlet.java:56)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
> 	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
> 	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:363)
> 	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
> 	at
> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
> 	at
> org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
> 	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
> 	at org.mortbay.jetty.Server.handle(Server.java:324)
> 	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534)
> 	at
> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:864)
> 	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:533)
> 	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:207)
> 	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:403)
> 	at
> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
> 	at
> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:522)
> DEBUG - PhaseInterceptorChain          - Invoking handleFault on interceptor
> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor
> DEBUG - HttpSoapConsumerMarshaler      - Using default response content
> encoding.
> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
> interceptor org.apache.servicemix.soap.interceptors.xml.StaxOutInterceptor
> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
> interceptor
> org.apache.servicemix.soap.bindings.soap.interceptors.SoapOutInterceptor
> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
> interceptor
> org.apache.servicemix.soap.bindings.soap.interceptors.SoapFaultOutInterceptor
> 
> 
> Jean-Baptiste Onofré wrote:
>> Hi Long,
>>
>> In your CXF-SE xbean.xml, I see that you try to make the JNDI lookup on 
>> a Weblogic application server.
>>
>> Nevertheless, I can't see the weblogic.jar file into your SU lib
>> directory.
>>
>> To be able to make JNDI lookup and RMI-IIOP, you need the weblogic 
>> client lib.
>>
>> In your pom.xml, you should have a dependency like this:
>>
>> <dependency>
>>    <groupId>com.oracle.weblogic</groupId>
>>    <artifactId>server</artifactId>
>>    <version>10.3</version>
>> </dependency>
>>
>> You can install the weblogic.jar into your maven working copy using:
>> mvn install:install-file -DgroupId=com.oracle.weblogic 
>> -DartifactId=server -Dfile=$WLS_HOME/server/lib/weblogic.jar 
>> -Dversion=10.3 -Dpackaging=jar
>>
>> Could you make a try adding the weblogic.jar into the SU ?
>>
>> Regards
>> JB
>>
>> laolong wrote:
>>>  Hi JB,
>>>     
>>>      http://www.nabble.com/file/p23978791/demo.zip demo.zip 
>>>
>>>     I built a test EJB but got same error again, all java code and bean
>>> defination are in attached, could you please review it?
>>>     
>>>     I'm sorry that cannot find a way to send email with attachement to
>>> you
>>> alone, so I have to use 'Reply' page to upload the file.
>>>
>>>    Thanks a lot.
>>>
>>> Long  
>>>
>>>
>>> Hummm, weird.
>>>
>>> Could you provide the annotate in the your LoginService class (and the 
>>> corresponding interface) ?
>>> It looks like that the CXF-SE side is not deployed correctly (and so the 
>>> HTTP component can't find it).
>>> Have you all EJB proxy requirements present in your SU zip (EJBs stub, 
>>> etc) ?
>>> Is it possible to provide your cxf-se zip file (only to my, not on the 
>>> mailing list) ?
>>>
>>> Regards
>>> JB
>>
> 

Re: How to invoke EJB and How to disable WSDL validation in http:soap-consumer/provider?

Posted by laolong <le...@sina.com>.

  I have tried to use HTML form, Java code and XMLSpy to POST soap request,
but the inbound message in HTTP component are all empty if use
request.getParameter(""), it's strange that seems only my SMX has this
problem...


Jean-Baptiste Onofré wrote:
> 
> Well,
> 
> I have understood what's happen.
> 
> In the HttpSoapConsumerMarshaler, in the createExchange method, the 
> message content is set only for the POST method:
> 
>          headers.put(HttpConstants.REQUEST_URI, 
> request.getRequestURL().toString());
>          headers.put(HttpConstants.CONTENT_TYPE,
> request.getContentType());
>          headers.put(HttpConstants.REQUEST_METHOD, method);
>          if (HttpConstants.METHOD_POST.equals(method) || 
> HttpConstants.METHOD_PUT.equals(method)) {
>              msg.setContent(InputStream.class, request.getInputStream());
>          }
> 
> So, if you try to submit using GET method, the message setContent() 
> method is never called. And so the message content is null.
> That's why the interceptor raise the NullPointerException.
> 
> Could you try using the POST method ?
> 
> Nevertheless, I think that you can raise a jira, at least to raise a 
> better exception message.
> 
> Regards
> JB
> 
> laolong wrote:
>> 
>> Hi JB,
>> 
>>    Now I believe the problem is caused by HTTP component/Jetty issue, the
>> HTTP component cannot get POST data from HTTP request.  
>>    1. I create a SOAP marshaler and overwrite function createExchange
>> using
>> the source code from
>> org.apache.servicemix.http.endpoints.HttpSoapConsumerMarshaler.java like
>> below and remove REQUESt method checking (in red), then I can get correct
>> SOAP response from XMLSpy.
>> 
>> public MessageExchange createExchange(HttpServletRequest request,
>> 			ComponentContext context) throws Exception {
>> 		String method = request.getMethod();
>> 		System.out.println(method);
>> 		Message msg = super.getBinding().createMessage();
>> 		msg.put(ComponentContext.class, context);
>> 		msg.put(JbiConstants.USE_JBI_WRAPPER, super.isUseJbiWrapper());
>> 		msg.put(Message.CONTENT_TYPE, request.getContentType());
>> 		Map<String, String> headers = msg.getTransportHeaders();
>> 		for (Enumeration<?> e = request.getHeaderNames(); e.hasMoreElements();)
>> {
>> 			String name = (String) e.nextElement();
>> 			String value = request.getHeader(name);
>> 			headers.put(name, value);
>> 		}
>> 		headers.put(HttpConstants.REQUEST_URI, request.getRequestURL()
>> 				.toString());
>> 		headers.put(HttpConstants.CONTENT_TYPE, request.getContentType());
>> 		headers.put(HttpConstants.REQUEST_METHOD, method);
>> //		if (HttpConstants.METHOD_POST.equals(method)
>> //				|| HttpConstants.METHOD_PUT.equals(method)) {
>> 			msg.setContent(InputStream.class, request.getInputStream());
>> //		}
>> 		request.setAttribute(Message.class.getName(), msg);
>> 		InterceptorChain phase = getChain(Phase.ServerIn);
>> 		phase.doIntercept(msg);
>> 		return msg.getContent(MessageExchange.class);
>> 
>> 	}
>>    2. I also tried to use <http:endpoint>, it also get following error
>> message
>> 
>>    <pre>org.apache.cxf.interceptor.Fault: no jbi message element
>> 	at
>> org.apache.cxf.binding.jbi.interceptor.JBIWrapperInInterceptor.handleMessage(JBIWrapperInInterceptor.java:102)
>> 	at
>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
>> 	at
>> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:89)
>> 	at
>> org.apache.cxf.transport.jbi.JBIDispatcherUtil.dispatch(JBIDispatcherUtil.java:156)
>> 	at
>> org.apache.servicemix.cxfse.CxfSeEndpoint.process(CxfSeEndpoint.java:364)
>> 	at
>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:627)
>> 	at
>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:581)
>> 	at
>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:535)
>> 	at
>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>> 	at
>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:623)
>> 	at
>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>> 	at
>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>> 	at
>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>> 	at
>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
>> 	at
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
>> 	at java.lang.Thread.run(Thread.java:595)
>> </pre>
>> 
>> 
>> Thanks.
>> Long
>> 
>> 
>> 
>> Jean-Baptiste Onofré wrote:
>>> OK,
>>>
>>> The NullPointerException is raised into the Soap marshaler.
>>>
>>> Could you make a quick test using the "old" HTTP endpoint like this:
>>>     <http:endpoint service="service"
>>>                    endpoint="http"
>>>                    role="consumer"
>>>                    targetService="service"
>>>                    targetEndpoint="ejb"
>>>                    locationURI="http://0.0.0.0:8181/what/you/want"
>>>                    defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
>>>                    soap="true"
>>>                    />
>>>
>>> During this time, I take a look on the interceptor usage in the default 
>>> SOAP marshaler.
>>>
>>> Regards
>>> JB
>>>
>>> laolong wrote:
>>>> Hi JB,
>>>>    Yes, I think CXF-SU internal endpoint should be working.
>>>>    I tried servicemix-http-2009.01.0.1-fuse-installer.zip (FUSE
>>>> 3.4.0.2)
>>>> and
>>>> servicemix-http-2008.01-installer.zip(Servicemix3.3) , got same
>>>> 'InputStream
>>>> content not found' error.
>>>>
>>>> Thanks,
>>>> Long
>>>>
>>>>
>>>>
>>>> Jean-Baptiste Onofré wrote:
>>>>> If you can get the WSDL generated by CXF, the CXF-SU should be OK.
>>>>>
>>>>> I'm going to check in the HTTP component source code where is raised
>>>>> the 
>>>>>   NullPointerException.
>>>>> What's the version of the HTTP component that you use ?
>>>>>
>>>>> Regards
>>>>> JB
>>>>>
>>>>> laolong wrote:
>>>>>>  I guess the problem also caused by Http/Jetty issue, the request
>>>>>> message
>>>>>> cannot be processed, message content is lost due to the SOAP message
>>>>>> POST
>>>>>> by
>>>>>> XMLSpy is received with wrong method 'GET'
>>>>>>
>>>>>> SMX log---------------------------------------------
>>>>>>
>>>>>> DEBUG - HttpComponent                  - Receiving HTTP request: GET
>>>>>> /LoginServiceService/main.wsdl HTTP/1.1
>>>>>> Accept: */*
>>>>>> User-Agent: XML Spy
>>>>>> Host: bjc-d-xp:8199
>>>>>> Connection: Keep-Alive
>>>>>> Cache-Control: no-cache
>>>>>>
>>>>>>
>>>>>> DEBUG - JettyContextManager            - Dispatching job:
>>>>>> SCEP@10234051[d=true,io=0,w=true,b=false|false]
>>>>>> DEBUG - JettyContextManager            - Dispatching job:
>>>>>> SCEP@10234051[d=true,io=1,w=true,b=false|false]
>>>>>> DEBUG - JettyContextManager            - Dispatching job:
>>>>>> SCEP@10234051[d=true,io=1,w=true,b=false|false]
>>>>>> DEBUG - HttpComponent                  - Receiving HTTP request: GET
>>>>>> /LoginServiceService/ HTTP/1.1
>>>>>> User-Agent: XML Spy
>>>>>> SOAPAction: "urn:Login"
>>>>>> Host: localhost:8199
>>>>>> Connection: Keep-Alive
>>>>>> Cache-Control: no-cache
>>>>>>
>>>>>>
>>>>>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
>>>>>> interceptor
>>>>>> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor
>>>>>> INFO  - PhaseInterceptorChain          - Interceptor has thrown
>>>>>> exception,
>>>>>> unwinding now
>>>>>> java.lang.NullPointerException: InputStream content not found
>>>>>> 	at
>>>>>> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor.handleMessage(AttachmentsInInterceptor.java:46)
>>>>>> 	at
>>>>>> org.apache.servicemix.soap.core.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:85)
>>>>>> 	at
>>>>>> org.apache.servicemix.http.endpoints.HttpSoapConsumerMarshaler.createExchange(HttpSoapConsumerMarshaler.java:107)
>>>>>> 	at
>>>>>> org.apache.servicemix.http.endpoints.HttpConsumerEndpoint.createExchange(HttpConsumerEndpoint.java:488)
>>>>>> 	at
>>>>>> org.apache.servicemix.http.endpoints.HttpConsumerEndpoint.process(HttpConsumerEndpoint.java:293)
>>>>>> 	at
>>>>>> org.apache.servicemix.http.HttpBridgeServlet.service(HttpBridgeServlet.java:56)
>>>>>> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
>>>>>> 	at
>>>>>> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
>>>>>> 	at
>>>>>> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:363)
>>>>>> 	at
>>>>>> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
>>>>>> 	at
>>>>>> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
>>>>>> 	at
>>>>>> org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
>>>>>> 	at
>>>>>> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
>>>>>> 	at org.mortbay.jetty.Server.handle(Server.java:324)
>>>>>> 	at
>>>>>> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534)
>>>>>> 	at
>>>>>> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:864)
>>>>>> 	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:533)
>>>>>> 	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:207)
>>>>>> 	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:403)
>>>>>> 	at
>>>>>> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
>>>>>> 	at
>>>>>> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:522)
>>>>>> DEBUG - PhaseInterceptorChain          - Invoking handleFault on
>>>>>> interceptor
>>>>>> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor
>>>>>> DEBUG - HttpSoapConsumerMarshaler      - Using default response
>>>>>> content
>>>>>> encoding.
>>>>>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
>>>>>> interceptor
>>>>>> org.apache.servicemix.soap.interceptors.xml.StaxOutInterceptor
>>>>>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
>>>>>> interceptor
>>>>>> org.apache.servicemix.soap.bindings.soap.interceptors.SoapOutInterceptor
>>>>>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
>>>>>> interceptor
>>>>>> org.apache.servicemix.soap.bindings.soap.interceptors.SoapFaultOutInterceptor
>>>>>>
>>>>>>
>>>>>> Jean-Baptiste Onofré wrote:
>>>>>>> Hi Long,
>>>>>>>
>>>>>>> In your CXF-SE xbean.xml, I see that you try to make the JNDI lookup
>>>>>>> on 
>>>>>>> a Weblogic application server.
>>>>>>>
>>>>>>> Nevertheless, I can't see the weblogic.jar file into your SU lib
>>>>>>> directory.
>>>>>>>
>>>>>>> To be able to make JNDI lookup and RMI-IIOP, you need the weblogic 
>>>>>>> client lib.
>>>>>>>
>>>>>>> In your pom.xml, you should have a dependency like this:
>>>>>>>
>>>>>>> <dependency>
>>>>>>>    <groupId>com.oracle.weblogic</groupId>
>>>>>>>    <artifactId>server</artifactId>
>>>>>>>    <version>10.3</version>
>>>>>>> </dependency>
>>>>>>>
>>>>>>> You can install the weblogic.jar into your maven working copy using:
>>>>>>> mvn install:install-file -DgroupId=com.oracle.weblogic 
>>>>>>> -DartifactId=server -Dfile=$WLS_HOME/server/lib/weblogic.jar 
>>>>>>> -Dversion=10.3 -Dpackaging=jar
>>>>>>>
>>>>>>> Could you make a try adding the weblogic.jar into the SU ?
>>>>>>>
>>>>>>> Regards
>>>>>>> JB
>>>>>>>
>>>>>>> laolong wrote:
>>>>>>>>  Hi JB,
>>>>>>>>     
>>>>>>>>      http://www.nabble.com/file/p23978791/demo.zip demo.zip 
>>>>>>>>
>>>>>>>>     I built a test EJB but got same error again, all java code and
>>>>>>>> bean
>>>>>>>> defination are in attached, could you please review it?
>>>>>>>>     
>>>>>>>>     I'm sorry that cannot find a way to send email with attachement
>>>>>>>> to
>>>>>>>> you
>>>>>>>> alone, so I have to use 'Reply' page to upload the file.
>>>>>>>>
>>>>>>>>    Thanks a lot.
>>>>>>>>
>>>>>>>> Long  
>>>>>>>>
>>>>>>>>
>>>>>>>> Hummm, weird.
>>>>>>>>
>>>>>>>> Could you provide the annotate in the your LoginService class (and
>>>>>>>> the 
>>>>>>>> corresponding interface) ?
>>>>>>>> It looks like that the CXF-SE side is not deployed correctly (and
>>>>>>>> so
>>>>>>>> the 
>>>>>>>> HTTP component can't find it).
>>>>>>>> Have you all EJB proxy requirements present in your SU zip (EJBs
>>>>>>>> stub, 
>>>>>>>> etc) ?
>>>>>>>> Is it possible to provide your cxf-se zip file (only to my, not on
>>>>>>>> the 
>>>>>>>> mailing list) ?
>>>>>>>>
>>>>>>>> Regards
>>>>>>>> JB
>>>
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-invoke-EJB-and-How-to-disable-WSDL-validation-in-http%3Asoap-consumer-provider--tp23963883p23994315.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: How to invoke EJB and How to disable WSDL validation in http:soap-consumer/provider?

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Well,

I have understood what's happen.

In the HttpSoapConsumerMarshaler, in the createExchange method, the 
message content is set only for the POST method:

         headers.put(HttpConstants.REQUEST_URI, 
request.getRequestURL().toString());
         headers.put(HttpConstants.CONTENT_TYPE, request.getContentType());
         headers.put(HttpConstants.REQUEST_METHOD, method);
         if (HttpConstants.METHOD_POST.equals(method) || 
HttpConstants.METHOD_PUT.equals(method)) {
             msg.setContent(InputStream.class, request.getInputStream());
         }

So, if you try to submit using GET method, the message setContent() 
method is never called. And so the message content is null.
That's why the interceptor raise the NullPointerException.

Could you try using the POST method ?

Nevertheless, I think that you can raise a jira, at least to raise a 
better exception message.

Regards
JB

laolong wrote:
> 
> Hi JB,
> 
>    Now I believe the problem is caused by HTTP component/Jetty issue, the
> HTTP component cannot get POST data from HTTP request.  
>    1. I create a SOAP marshaler and overwrite function createExchange using
> the source code from
> org.apache.servicemix.http.endpoints.HttpSoapConsumerMarshaler.java like
> below and remove REQUESt method checking (in red), then I can get correct
> SOAP response from XMLSpy.
> 
> public MessageExchange createExchange(HttpServletRequest request,
> 			ComponentContext context) throws Exception {
> 		String method = request.getMethod();
> 		System.out.println(method);
> 		Message msg = super.getBinding().createMessage();
> 		msg.put(ComponentContext.class, context);
> 		msg.put(JbiConstants.USE_JBI_WRAPPER, super.isUseJbiWrapper());
> 		msg.put(Message.CONTENT_TYPE, request.getContentType());
> 		Map<String, String> headers = msg.getTransportHeaders();
> 		for (Enumeration<?> e = request.getHeaderNames(); e.hasMoreElements();) {
> 			String name = (String) e.nextElement();
> 			String value = request.getHeader(name);
> 			headers.put(name, value);
> 		}
> 		headers.put(HttpConstants.REQUEST_URI, request.getRequestURL()
> 				.toString());
> 		headers.put(HttpConstants.CONTENT_TYPE, request.getContentType());
> 		headers.put(HttpConstants.REQUEST_METHOD, method);
> //		if (HttpConstants.METHOD_POST.equals(method)
> //				|| HttpConstants.METHOD_PUT.equals(method)) {
> 			msg.setContent(InputStream.class, request.getInputStream());
> //		}
> 		request.setAttribute(Message.class.getName(), msg);
> 		InterceptorChain phase = getChain(Phase.ServerIn);
> 		phase.doIntercept(msg);
> 		return msg.getContent(MessageExchange.class);
> 
> 	}
>    2. I also tried to use <http:endpoint>, it also get following error
> message
> 
>    <pre>org.apache.cxf.interceptor.Fault: no jbi message element
> 	at
> org.apache.cxf.binding.jbi.interceptor.JBIWrapperInInterceptor.handleMessage(JBIWrapperInInterceptor.java:102)
> 	at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
> 	at
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:89)
> 	at
> org.apache.cxf.transport.jbi.JBIDispatcherUtil.dispatch(JBIDispatcherUtil.java:156)
> 	at
> org.apache.servicemix.cxfse.CxfSeEndpoint.process(CxfSeEndpoint.java:364)
> 	at
> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:627)
> 	at
> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:581)
> 	at
> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:535)
> 	at
> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
> 	at
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:623)
> 	at
> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
> 	at
> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
> 	at
> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
> 	at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
> 	at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
> 	at java.lang.Thread.run(Thread.java:595)
> </pre>
> 
> 
> Thanks.
> Long
> 
> 
> 
> Jean-Baptiste Onofré wrote:
>> OK,
>>
>> The NullPointerException is raised into the Soap marshaler.
>>
>> Could you make a quick test using the "old" HTTP endpoint like this:
>>     <http:endpoint service="service"
>>                    endpoint="http"
>>                    role="consumer"
>>                    targetService="service"
>>                    targetEndpoint="ejb"
>>                    locationURI="http://0.0.0.0:8181/what/you/want"
>>                    defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
>>                    soap="true"
>>                    />
>>
>> During this time, I take a look on the interceptor usage in the default 
>> SOAP marshaler.
>>
>> Regards
>> JB
>>
>> laolong wrote:
>>> Hi JB,
>>>    Yes, I think CXF-SU internal endpoint should be working.
>>>    I tried servicemix-http-2009.01.0.1-fuse-installer.zip (FUSE 3.4.0.2)
>>> and
>>> servicemix-http-2008.01-installer.zip(Servicemix3.3) , got same
>>> 'InputStream
>>> content not found' error.
>>>
>>> Thanks,
>>> Long
>>>
>>>
>>>
>>> Jean-Baptiste Onofré wrote:
>>>> If you can get the WSDL generated by CXF, the CXF-SU should be OK.
>>>>
>>>> I'm going to check in the HTTP component source code where is raised the 
>>>>   NullPointerException.
>>>> What's the version of the HTTP component that you use ?
>>>>
>>>> Regards
>>>> JB
>>>>
>>>> laolong wrote:
>>>>>  I guess the problem also caused by Http/Jetty issue, the request
>>>>> message
>>>>> cannot be processed, message content is lost due to the SOAP message
>>>>> POST
>>>>> by
>>>>> XMLSpy is received with wrong method 'GET'
>>>>>
>>>>> SMX log---------------------------------------------
>>>>>
>>>>> DEBUG - HttpComponent                  - Receiving HTTP request: GET
>>>>> /LoginServiceService/main.wsdl HTTP/1.1
>>>>> Accept: */*
>>>>> User-Agent: XML Spy
>>>>> Host: bjc-d-xp:8199
>>>>> Connection: Keep-Alive
>>>>> Cache-Control: no-cache
>>>>>
>>>>>
>>>>> DEBUG - JettyContextManager            - Dispatching job:
>>>>> SCEP@10234051[d=true,io=0,w=true,b=false|false]
>>>>> DEBUG - JettyContextManager            - Dispatching job:
>>>>> SCEP@10234051[d=true,io=1,w=true,b=false|false]
>>>>> DEBUG - JettyContextManager            - Dispatching job:
>>>>> SCEP@10234051[d=true,io=1,w=true,b=false|false]
>>>>> DEBUG - HttpComponent                  - Receiving HTTP request: GET
>>>>> /LoginServiceService/ HTTP/1.1
>>>>> User-Agent: XML Spy
>>>>> SOAPAction: "urn:Login"
>>>>> Host: localhost:8199
>>>>> Connection: Keep-Alive
>>>>> Cache-Control: no-cache
>>>>>
>>>>>
>>>>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
>>>>> interceptor
>>>>> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor
>>>>> INFO  - PhaseInterceptorChain          - Interceptor has thrown
>>>>> exception,
>>>>> unwinding now
>>>>> java.lang.NullPointerException: InputStream content not found
>>>>> 	at
>>>>> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor.handleMessage(AttachmentsInInterceptor.java:46)
>>>>> 	at
>>>>> org.apache.servicemix.soap.core.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:85)
>>>>> 	at
>>>>> org.apache.servicemix.http.endpoints.HttpSoapConsumerMarshaler.createExchange(HttpSoapConsumerMarshaler.java:107)
>>>>> 	at
>>>>> org.apache.servicemix.http.endpoints.HttpConsumerEndpoint.createExchange(HttpConsumerEndpoint.java:488)
>>>>> 	at
>>>>> org.apache.servicemix.http.endpoints.HttpConsumerEndpoint.process(HttpConsumerEndpoint.java:293)
>>>>> 	at
>>>>> org.apache.servicemix.http.HttpBridgeServlet.service(HttpBridgeServlet.java:56)
>>>>> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
>>>>> 	at
>>>>> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
>>>>> 	at
>>>>> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:363)
>>>>> 	at
>>>>> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
>>>>> 	at
>>>>> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
>>>>> 	at
>>>>> org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
>>>>> 	at
>>>>> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
>>>>> 	at org.mortbay.jetty.Server.handle(Server.java:324)
>>>>> 	at
>>>>> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534)
>>>>> 	at
>>>>> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:864)
>>>>> 	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:533)
>>>>> 	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:207)
>>>>> 	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:403)
>>>>> 	at
>>>>> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
>>>>> 	at
>>>>> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:522)
>>>>> DEBUG - PhaseInterceptorChain          - Invoking handleFault on
>>>>> interceptor
>>>>> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor
>>>>> DEBUG - HttpSoapConsumerMarshaler      - Using default response content
>>>>> encoding.
>>>>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
>>>>> interceptor
>>>>> org.apache.servicemix.soap.interceptors.xml.StaxOutInterceptor
>>>>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
>>>>> interceptor
>>>>> org.apache.servicemix.soap.bindings.soap.interceptors.SoapOutInterceptor
>>>>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
>>>>> interceptor
>>>>> org.apache.servicemix.soap.bindings.soap.interceptors.SoapFaultOutInterceptor
>>>>>
>>>>>
>>>>> Jean-Baptiste Onofré wrote:
>>>>>> Hi Long,
>>>>>>
>>>>>> In your CXF-SE xbean.xml, I see that you try to make the JNDI lookup
>>>>>> on 
>>>>>> a Weblogic application server.
>>>>>>
>>>>>> Nevertheless, I can't see the weblogic.jar file into your SU lib
>>>>>> directory.
>>>>>>
>>>>>> To be able to make JNDI lookup and RMI-IIOP, you need the weblogic 
>>>>>> client lib.
>>>>>>
>>>>>> In your pom.xml, you should have a dependency like this:
>>>>>>
>>>>>> <dependency>
>>>>>>    <groupId>com.oracle.weblogic</groupId>
>>>>>>    <artifactId>server</artifactId>
>>>>>>    <version>10.3</version>
>>>>>> </dependency>
>>>>>>
>>>>>> You can install the weblogic.jar into your maven working copy using:
>>>>>> mvn install:install-file -DgroupId=com.oracle.weblogic 
>>>>>> -DartifactId=server -Dfile=$WLS_HOME/server/lib/weblogic.jar 
>>>>>> -Dversion=10.3 -Dpackaging=jar
>>>>>>
>>>>>> Could you make a try adding the weblogic.jar into the SU ?
>>>>>>
>>>>>> Regards
>>>>>> JB
>>>>>>
>>>>>> laolong wrote:
>>>>>>>  Hi JB,
>>>>>>>     
>>>>>>>      http://www.nabble.com/file/p23978791/demo.zip demo.zip 
>>>>>>>
>>>>>>>     I built a test EJB but got same error again, all java code and
>>>>>>> bean
>>>>>>> defination are in attached, could you please review it?
>>>>>>>     
>>>>>>>     I'm sorry that cannot find a way to send email with attachement
>>>>>>> to
>>>>>>> you
>>>>>>> alone, so I have to use 'Reply' page to upload the file.
>>>>>>>
>>>>>>>    Thanks a lot.
>>>>>>>
>>>>>>> Long  
>>>>>>>
>>>>>>>
>>>>>>> Hummm, weird.
>>>>>>>
>>>>>>> Could you provide the annotate in the your LoginService class (and
>>>>>>> the 
>>>>>>> corresponding interface) ?
>>>>>>> It looks like that the CXF-SE side is not deployed correctly (and so
>>>>>>> the 
>>>>>>> HTTP component can't find it).
>>>>>>> Have you all EJB proxy requirements present in your SU zip (EJBs
>>>>>>> stub, 
>>>>>>> etc) ?
>>>>>>> Is it possible to provide your cxf-se zip file (only to my, not on
>>>>>>> the 
>>>>>>> mailing list) ?
>>>>>>>
>>>>>>> Regards
>>>>>>> JB
>>
> 

Re: How to invoke EJB and How to disable WSDL validation in http:soap-consumer/provider?

Posted by laolong <le...@sina.com>.
Hi JB,

   I checked src about validateWsdl attribute, it's just used for WS-I BP
compliancy validation, that's the reason I get 'Could not find service ...'
error when use a 'fake' WSDL file.

public class HttpSoapConsumerEndpoint extends HttpConsumerEndpoint {
 .......................
 private void validateWsdl1(HttpSoapConsumerMarshaler marshaler) throws
WSDLException, IOException,
                    DeploymentException {
        Definition def =
WSDLUtils.createWSDL11Reader().readWSDL(wsdl.getURL().toString());
        if (validateWsdl) {
            WSIBPValidator validator = new WSIBPValidator(def);
            if (!validator.isValid()) {
                throw new DeploymentException("WSDL is not WS-I BP
compliant: " + validator.getErrors());
            }
        }
        Service svc;
        if (getService() != null) {
            svc = def.getService(getService());
            if (svc == null) {
                throw new DeploymentException("Could not find service '" +
getService() + "' in wsdl");
            }
        } else if (def.getServices().size() == 1) {
            svc = (Service) def.getServices().values().iterator().next();
            setService(svc.getQName());
        } else {
            throw new DeploymentException(
                            "If service is not set, the WSDL must contain a
single service definition");
        }
        Port port;
        if (getEndpoint() != null) {
            port = svc.getPort(getEndpoint());
            if (port == null) {
                throw new DeploymentException("Cound not find port '" +
getEndpoint()
                                + "' in wsdl for service '" + getService() +
"'");
            }
        } else if (svc.getPorts().size() == 1) {
            port = (Port) svc.getPorts().values().iterator().next();
            setEndpoint(port.getName());
        } else {
            throw new DeploymentException("If endpoint is not set, the WSDL
service '" + getService()
                            + "' must contain a single port definition");
        }
        SOAPAddress soapAddress = WSDLUtils.getExtension(port,
SOAPAddress.class);
        if (soapAddress != null) {
            soapAddress.setLocationURI(getLocationURI());
        } else {
            SOAP12Address soap12Address = WSDLUtils.getExtension(port,
SOAP12Address.class);
            if (soap12Address != null) {
                soap12Address.setLocationURI(getLocationURI());
            }
        }
        description =
WSDLUtils.getWSDL11Factory().newWSDLWriter().getDocument(def);
        marshaler.setBinding(BindingFactory.createBinding(port));
    }


  

  I have changed to use jsr181:pojo+ http:endpoint,  it works well to expose
EJB as webservice without write WSDL.

 Thanks for your help.

Regards,
Long


Jean-Baptiste Onofré wrote:
> 
> Hi Long,
> 
> Let me check in the HTTP component how the validateWsdl attribute works.
> Nevertheless, could you confirm that you can use both GET and POST 
> method or do you still have an issue on one of the method ?
> 
> Regards
> JB
> 
> laolong wrote:
>> 
>> Hi JB,
>> 
>>    GET works just when I remove RequestMethod checking, so there is no
>> problem in http component. Anyway, now the ejb proxy is working, but
>> another
>> open issue is the http:soap-consumer still need a valid WSDL file since
>> both
>> validateWsdl='no' and validateWsdl='false' are not effective, could you
>> help
>> to check if this flag is working on your side?
>> 
>> Thanks,
>> Long
>> 
>> 
>> Jean-Baptiste Onofré wrote:
>>> In fact, I'm suprised that it works in GET :)
>>> Regarding the code, it should work only in POST :)
>>>
>>> Could make both test and send me the corresponding logs ?
>>>
>>> Thanks,
>>> Regards
>>> JB
>>>
>>> laolong wrote:
>>>> Hi JB,
>>>>
>>>>    GET is OK, but most of SOAP messges should be sent using POST, how
>>>> can
>>>> I
>>>> make POST method working within http component? or I have to use Tomcat
>>>> instead of Jetty?
>>>>
>>>> Thanks,
>>>> Long
>>>>
>>>>
>>>> Jean-Baptiste Onofré wrote:
>>>>> Yes,
>>>>>
>>>>> I think that if you make a HTTP request using GET method, it should
>>>>> work.
>>>>>
>>>>> Regards
>>>>> JB
>>>>>
>>>>> laolong wrote:
>>>>>> Hi JB,
>>>>>>
>>>>>>    Now I believe the problem is caused by HTTP component/Jetty issue,
>>>>>> the
>>>>>> HTTP component cannot get POST data from HTTP request.  
>>>>>>    1. I create a SOAP marshaler and overwrite function createExchange
>>>>>> using
>>>>>> the source code from
>>>>>> org.apache.servicemix.http.endpoints.HttpSoapConsumerMarshaler.java
>>>>>> like
>>>>>> below and remove REQUESt method checking (in red), then I can get
>>>>>> correct
>>>>>> SOAP response from XMLSpy.
>>>>>>
>>>>>> public MessageExchange createExchange(HttpServletRequest request,
>>>>>> 			ComponentContext context) throws Exception {
>>>>>> 		String method = request.getMethod();
>>>>>> 		System.out.println(method);
>>>>>> 		Message msg = super.getBinding().createMessage();
>>>>>> 		msg.put(ComponentContext.class, context);
>>>>>> 		msg.put(JbiConstants.USE_JBI_WRAPPER, super.isUseJbiWrapper());
>>>>>> 		msg.put(Message.CONTENT_TYPE, request.getContentType());
>>>>>> 		Map<String, String> headers = msg.getTransportHeaders();
>>>>>> 		for (Enumeration<?> e = request.getHeaderNames();
>>>>>> e.hasMoreElements();)
>>>>>> {
>>>>>> 			String name = (String) e.nextElement();
>>>>>> 			String value = request.getHeader(name);
>>>>>> 			headers.put(name, value);
>>>>>> 		}
>>>>>> 		headers.put(HttpConstants.REQUEST_URI, request.getRequestURL()
>>>>>> 				.toString());
>>>>>> 		headers.put(HttpConstants.CONTENT_TYPE, request.getContentType());
>>>>>> 		headers.put(HttpConstants.REQUEST_METHOD, method);
>>>>>> //		if (HttpConstants.METHOD_POST.equals(method)
>>>>>> //				|| HttpConstants.METHOD_PUT.equals(method)) {
>>>>>> 			msg.setContent(InputStream.class, request.getInputStream());
>>>>>> //		}
>>>>>> 		request.setAttribute(Message.class.getName(), msg);
>>>>>> 		InterceptorChain phase = getChain(Phase.ServerIn);
>>>>>> 		phase.doIntercept(msg);
>>>>>> 		return msg.getContent(MessageExchange.class);
>>>>>>
>>>>>> 	}
>>>>>>    2. I also tried to use <http:endpoint>, it also get following
>>>>>> error
>>>>>> message
>>>>>>
>>>>>>    <pre>org.apache.cxf.interceptor.Fault: no jbi message element
>>>>>> 	at
>>>>>> org.apache.cxf.binding.jbi.interceptor.JBIWrapperInInterceptor.handleMessage(JBIWrapperInInterceptor.java:102)
>>>>>> 	at
>>>>>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
>>>>>> 	at
>>>>>> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:89)
>>>>>> 	at
>>>>>> org.apache.cxf.transport.jbi.JBIDispatcherUtil.dispatch(JBIDispatcherUtil.java:156)
>>>>>> 	at
>>>>>> org.apache.servicemix.cxfse.CxfSeEndpoint.process(CxfSeEndpoint.java:364)
>>>>>> 	at
>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:627)
>>>>>> 	at
>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:581)
>>>>>> 	at
>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:535)
>>>>>> 	at
>>>>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>>>>>> 	at
>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:623)
>>>>>> 	at
>>>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>>>>>> 	at
>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>>>>>> 	at
>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>>>>> 	at
>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
>>>>>> 	at
>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
>>>>>> 	at java.lang.Thread.run(Thread.java:595)
>>>>>> </pre>
>>>>>>
>>>>>>
>>>>>> Thanks.
>>>>>> Long
>>>>>>
>>>>>>
>>>>>>
>>>>>> Jean-Baptiste Onofré wrote:
>>>>>>> OK,
>>>>>>>
>>>>>>> The NullPointerException is raised into the Soap marshaler.
>>>>>>>
>>>>>>> Could you make a quick test using the "old" HTTP endpoint like this:
>>>>>>>     <http:endpoint service="service"
>>>>>>>                    endpoint="http"
>>>>>>>                    role="consumer"
>>>>>>>                    targetService="service"
>>>>>>>                    targetEndpoint="ejb"
>>>>>>>                    locationURI="http://0.0.0.0:8181/what/you/want"
>>>>>>>                   
>>>>>>> defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
>>>>>>>                    soap="true"
>>>>>>>                    />
>>>>>>>
>>>>>>> During this time, I take a look on the interceptor usage in the
>>>>>>> default 
>>>>>>> SOAP marshaler.
>>>>>>>
>>>>>>> Regards
>>>>>>> JB
>>>>>>>
>>>>>>> laolong wrote:
>>>>>>>> Hi JB,
>>>>>>>>    Yes, I think CXF-SU internal endpoint should be working.
>>>>>>>>    I tried servicemix-http-2009.01.0.1-fuse-installer.zip (FUSE
>>>>>>>> 3.4.0.2)
>>>>>>>> and
>>>>>>>> servicemix-http-2008.01-installer.zip(Servicemix3.3) , got same
>>>>>>>> 'InputStream
>>>>>>>> content not found' error.
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> Long
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Jean-Baptiste Onofré wrote:
>>>>>>>>> If you can get the WSDL generated by CXF, the CXF-SU should be OK.
>>>>>>>>>
>>>>>>>>> I'm going to check in the HTTP component source code where is
>>>>>>>>> raised
>>>>>>>>> the 
>>>>>>>>>   NullPointerException.
>>>>>>>>> What's the version of the HTTP component that you use ?
>>>>>>>>>
>>>>>>>>> Regards
>>>>>>>>> JB
>>>>>>>>>
>>>>>>>>> laolong wrote:
>>>>>>>>>>  I guess the problem also caused by Http/Jetty issue, the request
>>>>>>>>>> message
>>>>>>>>>> cannot be processed, message content is lost due to the SOAP
>>>>>>>>>> message
>>>>>>>>>> POST
>>>>>>>>>> by
>>>>>>>>>> XMLSpy is received with wrong method 'GET'
>>>>>>>>>>
>>>>>>>>>> SMX log---------------------------------------------
>>>>>>>>>>
>>>>>>>>>> DEBUG - HttpComponent                  - Receiving HTTP request:
>>>>>>>>>> GET
>>>>>>>>>> /LoginServiceService/main.wsdl HTTP/1.1
>>>>>>>>>> Accept: */*
>>>>>>>>>> User-Agent: XML Spy
>>>>>>>>>> Host: bjc-d-xp:8199
>>>>>>>>>> Connection: Keep-Alive
>>>>>>>>>> Cache-Control: no-cache
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> DEBUG - JettyContextManager            - Dispatching job:
>>>>>>>>>> SCEP@10234051[d=true,io=0,w=true,b=false|false]
>>>>>>>>>> DEBUG - JettyContextManager            - Dispatching job:
>>>>>>>>>> SCEP@10234051[d=true,io=1,w=true,b=false|false]
>>>>>>>>>> DEBUG - JettyContextManager            - Dispatching job:
>>>>>>>>>> SCEP@10234051[d=true,io=1,w=true,b=false|false]
>>>>>>>>>> DEBUG - HttpComponent                  - Receiving HTTP request:
>>>>>>>>>> GET
>>>>>>>>>> /LoginServiceService/ HTTP/1.1
>>>>>>>>>> User-Agent: XML Spy
>>>>>>>>>> SOAPAction: "urn:Login"
>>>>>>>>>> Host: localhost:8199
>>>>>>>>>> Connection: Keep-Alive
>>>>>>>>>> Cache-Control: no-cache
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage
>>>>>>>>>> on
>>>>>>>>>> interceptor
>>>>>>>>>> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor
>>>>>>>>>> INFO  - PhaseInterceptorChain          - Interceptor has thrown
>>>>>>>>>> exception,
>>>>>>>>>> unwinding now
>>>>>>>>>> java.lang.NullPointerException: InputStream content not found
>>>>>>>>>> 	at
>>>>>>>>>> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor.handleMessage(AttachmentsInInterceptor.java:46)
>>>>>>>>>> 	at
>>>>>>>>>> org.apache.servicemix.soap.core.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:85)
>>>>>>>>>> 	at
>>>>>>>>>> org.apache.servicemix.http.endpoints.HttpSoapConsumerMarshaler.createExchange(HttpSoapConsumerMarshaler.java:107)
>>>>>>>>>> 	at
>>>>>>>>>> org.apache.servicemix.http.endpoints.HttpConsumerEndpoint.createExchange(HttpConsumerEndpoint.java:488)
>>>>>>>>>> 	at
>>>>>>>>>> org.apache.servicemix.http.endpoints.HttpConsumerEndpoint.process(HttpConsumerEndpoint.java:293)
>>>>>>>>>> 	at
>>>>>>>>>> org.apache.servicemix.http.HttpBridgeServlet.service(HttpBridgeServlet.java:56)
>>>>>>>>>> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
>>>>>>>>>> 	at
>>>>>>>>>> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
>>>>>>>>>> 	at
>>>>>>>>>> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:363)
>>>>>>>>>> 	at
>>>>>>>>>> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
>>>>>>>>>> 	at
>>>>>>>>>> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
>>>>>>>>>> 	at
>>>>>>>>>> org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
>>>>>>>>>> 	at
>>>>>>>>>> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
>>>>>>>>>> 	at org.mortbay.jetty.Server.handle(Server.java:324)
>>>>>>>>>> 	at
>>>>>>>>>> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534)
>>>>>>>>>> 	at
>>>>>>>>>> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:864)
>>>>>>>>>> 	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:533)
>>>>>>>>>> 	at
>>>>>>>>>> org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:207)
>>>>>>>>>> 	at
>>>>>>>>>> org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:403)
>>>>>>>>>> 	at
>>>>>>>>>> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
>>>>>>>>>> 	at
>>>>>>>>>> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:522)
>>>>>>>>>> DEBUG - PhaseInterceptorChain          - Invoking handleFault on
>>>>>>>>>> interceptor
>>>>>>>>>> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor
>>>>>>>>>> DEBUG - HttpSoapConsumerMarshaler      - Using default response
>>>>>>>>>> content
>>>>>>>>>> encoding.
>>>>>>>>>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage
>>>>>>>>>> on
>>>>>>>>>> interceptor
>>>>>>>>>> org.apache.servicemix.soap.interceptors.xml.StaxOutInterceptor
>>>>>>>>>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage
>>>>>>>>>> on
>>>>>>>>>> interceptor
>>>>>>>>>> org.apache.servicemix.soap.bindings.soap.interceptors.SoapOutInterceptor
>>>>>>>>>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage
>>>>>>>>>> on
>>>>>>>>>> interceptor
>>>>>>>>>> org.apache.servicemix.soap.bindings.soap.interceptors.SoapFaultOutInterceptor
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Jean-Baptiste Onofré wrote:
>>>>>>>>>>> Hi Long,
>>>>>>>>>>>
>>>>>>>>>>> In your CXF-SE xbean.xml, I see that you try to make the JNDI
>>>>>>>>>>> lookup
>>>>>>>>>>> on 
>>>>>>>>>>> a Weblogic application server.
>>>>>>>>>>>
>>>>>>>>>>> Nevertheless, I can't see the weblogic.jar file into your SU lib
>>>>>>>>>>> directory.
>>>>>>>>>>>
>>>>>>>>>>> To be able to make JNDI lookup and RMI-IIOP, you need the
>>>>>>>>>>> weblogic 
>>>>>>>>>>> client lib.
>>>>>>>>>>>
>>>>>>>>>>> In your pom.xml, you should have a dependency like this:
>>>>>>>>>>>
>>>>>>>>>>> <dependency>
>>>>>>>>>>>    <groupId>com.oracle.weblogic</groupId>
>>>>>>>>>>>    <artifactId>server</artifactId>
>>>>>>>>>>>    <version>10.3</version>
>>>>>>>>>>> </dependency>
>>>>>>>>>>>
>>>>>>>>>>> You can install the weblogic.jar into your maven working copy
>>>>>>>>>>> using:
>>>>>>>>>>> mvn install:install-file -DgroupId=com.oracle.weblogic 
>>>>>>>>>>> -DartifactId=server -Dfile=$WLS_HOME/server/lib/weblogic.jar 
>>>>>>>>>>> -Dversion=10.3 -Dpackaging=jar
>>>>>>>>>>>
>>>>>>>>>>> Could you make a try adding the weblogic.jar into the SU ?
>>>>>>>>>>>
>>>>>>>>>>> Regards
>>>>>>>>>>> JB
>>>>>>>>>>>
>>>>>>>>>>> laolong wrote:
>>>>>>>>>>>>  Hi JB,
>>>>>>>>>>>>     
>>>>>>>>>>>>      http://www.nabble.com/file/p23978791/demo.zip demo.zip 
>>>>>>>>>>>>
>>>>>>>>>>>>     I built a test EJB but got same error again, all java code
>>>>>>>>>>>> and
>>>>>>>>>>>> bean
>>>>>>>>>>>> defination are in attached, could you please review it?
>>>>>>>>>>>>     
>>>>>>>>>>>>     I'm sorry that cannot find a way to send email with
>>>>>>>>>>>> attachement
>>>>>>>>>>>> to
>>>>>>>>>>>> you
>>>>>>>>>>>> alone, so I have to use 'Reply' page to upload the file.
>>>>>>>>>>>>
>>>>>>>>>>>>    Thanks a lot.
>>>>>>>>>>>>
>>>>>>>>>>>> Long  
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Hummm, weird.
>>>>>>>>>>>>
>>>>>>>>>>>> Could you provide the annotate in the your LoginService class
>>>>>>>>>>>> (and
>>>>>>>>>>>> the 
>>>>>>>>>>>> corresponding interface) ?
>>>>>>>>>>>> It looks like that the CXF-SE side is not deployed correctly
>>>>>>>>>>>> (and
>>>>>>>>>>>> so
>>>>>>>>>>>> the 
>>>>>>>>>>>> HTTP component can't find it).
>>>>>>>>>>>> Have you all EJB proxy requirements present in your SU zip
>>>>>>>>>>>> (EJBs
>>>>>>>>>>>> stub, 
>>>>>>>>>>>> etc) ?
>>>>>>>>>>>> Is it possible to provide your cxf-se zip file (only to my, not
>>>>>>>>>>>> on
>>>>>>>>>>>> the 
>>>>>>>>>>>> mailing list) ?
>>>>>>>>>>>>
>>>>>>>>>>>> Regards
>>>>>>>>>>>> JB
>>>
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-invoke-EJB-and-How-to-disable-WSDL-validation-in-http%3Asoap-consumer-provider--tp23963883p24035160.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: How to invoke EJB and How to disable WSDL validation in http:soap-consumer/provider?

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Long,

Good news and thanks you for the update.

Regards
JB

laolong wrote:
> 
> Hi JB,
> 
>    You are right, HttpSoapConsumerMarshaler doesn't support GET method,
> actually, I use POST method to send data but it's changed to 'GET' in SMX
> log(caused by a missing slash in request url), so I rewrite my own
> SoapConsumerMarshaler class extends original HttpSoapConsumerMarshaler to
> make the 'fake' GET method work :) 
> 
>  headers.put(HttpConstants.REQUEST_METHOD, "POST"); 
>  // if (HttpConstants.METHOD_POST.equals(method) 
>  // || HttpConstants.METHOD_PUT.equals(method)) { 
>     msg.setContent(InputStream.class, request.getInputStream()); 
>  // } 
> 
>    Then I found Jetty(or http component?) would set the request method to
> GET when the service url isn't end with slash(/) even if client use POST.
> 
>    I can use POST method now, and in fact, we don't need to do GET.
> 
>  Thanks a lot!
> 
> Regards
> Long
> 
> 
> Jean-Baptiste Onofré wrote:
>> Hi Long,
>>
>> Let me check in the HTTP component how the validateWsdl attribute works.
>> Nevertheless, could you confirm that you can use both GET and POST 
>> method or do you still have an issue on one of the method ?
>>
>> Regards
>> JB
>>
>> laolong wrote:
>>> Hi JB,
>>>
>>>    GET works just when I remove RequestMethod checking, so there is no
>>> problem in http component. Anyway, now the ejb proxy is working, but
>>> another
>>> open issue is the http:soap-consumer still need a valid WSDL file since
>>> both
>>> validateWsdl='no' and validateWsdl='false' are not effective, could you
>>> help
>>> to check if this flag is working on your side?
>>>
>>> Thanks,
>>> Long
>>>
>>>
>>> Jean-Baptiste Onofré wrote:
>>>> In fact, I'm suprised that it works in GET :)
>>>> Regarding the code, it should work only in POST :)
>>>>
>>>> Could make both test and send me the corresponding logs ?
>>>>
>>>> Thanks,
>>>> Regards
>>>> JB
>>>>
>>>> laolong wrote:
>>>>> Hi JB,
>>>>>
>>>>>    GET is OK, but most of SOAP messges should be sent using POST, how
>>>>> can
>>>>> I
>>>>> make POST method working within http component? or I have to use Tomcat
>>>>> instead of Jetty?
>>>>>
>>>>> Thanks,
>>>>> Long
>>>>>
>>>>>
>>>>> Jean-Baptiste Onofré wrote:
>>>>>> Yes,
>>>>>>
>>>>>> I think that if you make a HTTP request using GET method, it should
>>>>>> work.
>>>>>>
>>>>>> Regards
>>>>>> JB
>>>>>>
>>>>>> laolong wrote:
>>>>>>> Hi JB,
>>>>>>>
>>>>>>>    Now I believe the problem is caused by HTTP component/Jetty issue,
>>>>>>> the
>>>>>>> HTTP component cannot get POST data from HTTP request.  
>>>>>>>    1. I create a SOAP marshaler and overwrite function createExchange
>>>>>>> using
>>>>>>> the source code from
>>>>>>> org.apache.servicemix.http.endpoints.HttpSoapConsumerMarshaler.java
>>>>>>> like
>>>>>>> below and remove REQUESt method checking (in red), then I can get
>>>>>>> correct
>>>>>>> SOAP response from XMLSpy.
>>>>>>>
>>>>>>> public MessageExchange createExchange(HttpServletRequest request,
>>>>>>> 			ComponentContext context) throws Exception {
>>>>>>> 		String method = request.getMethod();
>>>>>>> 		System.out.println(method);
>>>>>>> 		Message msg = super.getBinding().createMessage();
>>>>>>> 		msg.put(ComponentContext.class, context);
>>>>>>> 		msg.put(JbiConstants.USE_JBI_WRAPPER, super.isUseJbiWrapper());
>>>>>>> 		msg.put(Message.CONTENT_TYPE, request.getContentType());
>>>>>>> 		Map<String, String> headers = msg.getTransportHeaders();
>>>>>>> 		for (Enumeration<?> e = request.getHeaderNames();
>>>>>>> e.hasMoreElements();)
>>>>>>> {
>>>>>>> 			String name = (String) e.nextElement();
>>>>>>> 			String value = request.getHeader(name);
>>>>>>> 			headers.put(name, value);
>>>>>>> 		}
>>>>>>> 		headers.put(HttpConstants.REQUEST_URI, request.getRequestURL()
>>>>>>> 				.toString());
>>>>>>> 		headers.put(HttpConstants.CONTENT_TYPE, request.getContentType());
>>>>>>> 		headers.put(HttpConstants.REQUEST_METHOD, method);
>>>>>>> //		if (HttpConstants.METHOD_POST.equals(method)
>>>>>>> //				|| HttpConstants.METHOD_PUT.equals(method)) {
>>>>>>> 			msg.setContent(InputStream.class, request.getInputStream());
>>>>>>> //		}
>>>>>>> 		request.setAttribute(Message.class.getName(), msg);
>>>>>>> 		InterceptorChain phase = getChain(Phase.ServerIn);
>>>>>>> 		phase.doIntercept(msg);
>>>>>>> 		return msg.getContent(MessageExchange.class);
>>>>>>>
>>>>>>> 	}
>>>>>>>    2. I also tried to use <http:endpoint>, it also get following
>>>>>>> error
>>>>>>> message
>>>>>>>
>>>>>>>    <pre>org.apache.cxf.interceptor.Fault: no jbi message element
>>>>>>> 	at
>>>>>>> org.apache.cxf.binding.jbi.interceptor.JBIWrapperInInterceptor.handleMessage(JBIWrapperInInterceptor.java:102)
>>>>>>> 	at
>>>>>>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
>>>>>>> 	at
>>>>>>> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:89)
>>>>>>> 	at
>>>>>>> org.apache.cxf.transport.jbi.JBIDispatcherUtil.dispatch(JBIDispatcherUtil.java:156)
>>>>>>> 	at
>>>>>>> org.apache.servicemix.cxfse.CxfSeEndpoint.process(CxfSeEndpoint.java:364)
>>>>>>> 	at
>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:627)
>>>>>>> 	at
>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:581)
>>>>>>> 	at
>>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:535)
>>>>>>> 	at
>>>>>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>>>>>>> 	at
>>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:623)
>>>>>>> 	at
>>>>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>>>>>>> 	at
>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>>>>>>> 	at
>>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>>>>>> 	at
>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
>>>>>>> 	at
>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
>>>>>>> 	at java.lang.Thread.run(Thread.java:595)
>>>>>>> </pre>
>>>>>>>
>>>>>>>
>>>>>>> Thanks.
>>>>>>> Long
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Jean-Baptiste Onofré wrote:
>>>>>>>> OK,
>>>>>>>>
>>>>>>>> The NullPointerException is raised into the Soap marshaler.
>>>>>>>>
>>>>>>>> Could you make a quick test using the "old" HTTP endpoint like this:
>>>>>>>>     <http:endpoint service="service"
>>>>>>>>                    endpoint="http"
>>>>>>>>                    role="consumer"
>>>>>>>>                    targetService="service"
>>>>>>>>                    targetEndpoint="ejb"
>>>>>>>>                    locationURI="http://0.0.0.0:8181/what/you/want"
>>>>>>>>                   
>>>>>>>> defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
>>>>>>>>                    soap="true"
>>>>>>>>                    />
>>>>>>>>
>>>>>>>> During this time, I take a look on the interceptor usage in the
>>>>>>>> default 
>>>>>>>> SOAP marshaler.
>>>>>>>>
>>>>>>>> Regards
>>>>>>>> JB
>>>>>>>>
>>>>>>>> laolong wrote:
>>>>>>>>> Hi JB,
>>>>>>>>>    Yes, I think CXF-SU internal endpoint should be working.
>>>>>>>>>    I tried servicemix-http-2009.01.0.1-fuse-installer.zip (FUSE
>>>>>>>>> 3.4.0.2)
>>>>>>>>> and
>>>>>>>>> servicemix-http-2008.01-installer.zip(Servicemix3.3) , got same
>>>>>>>>> 'InputStream
>>>>>>>>> content not found' error.
>>>>>>>>>
>>>>>>>>> Thanks,
>>>>>>>>> Long
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Jean-Baptiste Onofré wrote:
>>>>>>>>>> If you can get the WSDL generated by CXF, the CXF-SU should be OK.
>>>>>>>>>>
>>>>>>>>>> I'm going to check in the HTTP component source code where is
>>>>>>>>>> raised
>>>>>>>>>> the 
>>>>>>>>>>   NullPointerException.
>>>>>>>>>> What's the version of the HTTP component that you use ?
>>>>>>>>>>
>>>>>>>>>> Regards
>>>>>>>>>> JB
>>>>>>>>>>
>>>>>>>>>> laolong wrote:
>>>>>>>>>>>  I guess the problem also caused by Http/Jetty issue, the request
>>>>>>>>>>> message
>>>>>>>>>>> cannot be processed, message content is lost due to the SOAP
>>>>>>>>>>> message
>>>>>>>>>>> POST
>>>>>>>>>>> by
>>>>>>>>>>> XMLSpy is received with wrong method 'GET'
>>>>>>>>>>>
>>>>>>>>>>> SMX log---------------------------------------------
>>>>>>>>>>>
>>>>>>>>>>> DEBUG - HttpComponent                  - Receiving HTTP request:
>>>>>>>>>>> GET
>>>>>>>>>>> /LoginServiceService/main.wsdl HTTP/1.1
>>>>>>>>>>> Accept: */*
>>>>>>>>>>> User-Agent: XML Spy
>>>>>>>>>>> Host: bjc-d-xp:8199
>>>>>>>>>>> Connection: Keep-Alive
>>>>>>>>>>> Cache-Control: no-cache
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> DEBUG - JettyContextManager            - Dispatching job:
>>>>>>>>>>> SCEP@10234051[d=true,io=0,w=true,b=false|false]
>>>>>>>>>>> DEBUG - JettyContextManager            - Dispatching job:
>>>>>>>>>>> SCEP@10234051[d=true,io=1,w=true,b=false|false]
>>>>>>>>>>> DEBUG - JettyContextManager            - Dispatching job:
>>>>>>>>>>> SCEP@10234051[d=true,io=1,w=true,b=false|false]
>>>>>>>>>>> DEBUG - HttpComponent                  - Receiving HTTP request:
>>>>>>>>>>> GET
>>>>>>>>>>> /LoginServiceService/ HTTP/1.1
>>>>>>>>>>> User-Agent: XML Spy
>>>>>>>>>>> SOAPAction: "urn:Login"
>>>>>>>>>>> Host: localhost:8199
>>>>>>>>>>> Connection: Keep-Alive
>>>>>>>>>>> Cache-Control: no-cache
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage
>>>>>>>>>>> on
>>>>>>>>>>> interceptor
>>>>>>>>>>> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor
>>>>>>>>>>> INFO  - PhaseInterceptorChain          - Interceptor has thrown
>>>>>>>>>>> exception,
>>>>>>>>>>> unwinding now
>>>>>>>>>>> java.lang.NullPointerException: InputStream content not found
>>>>>>>>>>> 	at
>>>>>>>>>>> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor.handleMessage(AttachmentsInInterceptor.java:46)
>>>>>>>>>>> 	at
>>>>>>>>>>> org.apache.servicemix.soap.core.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:85)
>>>>>>>>>>> 	at
>>>>>>>>>>> org.apache.servicemix.http.endpoints.HttpSoapConsumerMarshaler.createExchange(HttpSoapConsumerMarshaler.java:107)
>>>>>>>>>>> 	at
>>>>>>>>>>> org.apache.servicemix.http.endpoints.HttpConsumerEndpoint.createExchange(HttpConsumerEndpoint.java:488)
>>>>>>>>>>> 	at
>>>>>>>>>>> org.apache.servicemix.http.endpoints.HttpConsumerEndpoint.process(HttpConsumerEndpoint.java:293)
>>>>>>>>>>> 	at
>>>>>>>>>>> org.apache.servicemix.http.HttpBridgeServlet.service(HttpBridgeServlet.java:56)
>>>>>>>>>>> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
>>>>>>>>>>> 	at
>>>>>>>>>>> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
>>>>>>>>>>> 	at
>>>>>>>>>>> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:363)
>>>>>>>>>>> 	at
>>>>>>>>>>> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
>>>>>>>>>>> 	at
>>>>>>>>>>> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
>>>>>>>>>>> 	at
>>>>>>>>>>> org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
>>>>>>>>>>> 	at
>>>>>>>>>>> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
>>>>>>>>>>> 	at org.mortbay.jetty.Server.handle(Server.java:324)
>>>>>>>>>>> 	at
>>>>>>>>>>> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534)
>>>>>>>>>>> 	at
>>>>>>>>>>> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:864)
>>>>>>>>>>> 	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:533)
>>>>>>>>>>> 	at
>>>>>>>>>>> org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:207)
>>>>>>>>>>> 	at
>>>>>>>>>>> org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:403)
>>>>>>>>>>> 	at
>>>>>>>>>>> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
>>>>>>>>>>> 	at
>>>>>>>>>>> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:522)
>>>>>>>>>>> DEBUG - PhaseInterceptorChain          - Invoking handleFault on
>>>>>>>>>>> interceptor
>>>>>>>>>>> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor
>>>>>>>>>>> DEBUG - HttpSoapConsumerMarshaler      - Using default response
>>>>>>>>>>> content
>>>>>>>>>>> encoding.
>>>>>>>>>>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage
>>>>>>>>>>> on
>>>>>>>>>>> interceptor
>>>>>>>>>>> org.apache.servicemix.soap.interceptors.xml.StaxOutInterceptor
>>>>>>>>>>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage
>>>>>>>>>>> on
>>>>>>>>>>> interceptor
>>>>>>>>>>> org.apache.servicemix.soap.bindings.soap.interceptors.SoapOutInterceptor
>>>>>>>>>>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage
>>>>>>>>>>> on
>>>>>>>>>>> interceptor
>>>>>>>>>>> org.apache.servicemix.soap.bindings.soap.interceptors.SoapFaultOutInterceptor
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Jean-Baptiste Onofré wrote:
>>>>>>>>>>>> Hi Long,
>>>>>>>>>>>>
>>>>>>>>>>>> In your CXF-SE xbean.xml, I see that you try to make the JNDI
>>>>>>>>>>>> lookup
>>>>>>>>>>>> on 
>>>>>>>>>>>> a Weblogic application server.
>>>>>>>>>>>>
>>>>>>>>>>>> Nevertheless, I can't see the weblogic.jar file into your SU lib
>>>>>>>>>>>> directory.
>>>>>>>>>>>>
>>>>>>>>>>>> To be able to make JNDI lookup and RMI-IIOP, you need the
>>>>>>>>>>>> weblogic 
>>>>>>>>>>>> client lib.
>>>>>>>>>>>>
>>>>>>>>>>>> In your pom.xml, you should have a dependency like this:
>>>>>>>>>>>>
>>>>>>>>>>>> <dependency>
>>>>>>>>>>>>    <groupId>com.oracle.weblogic</groupId>
>>>>>>>>>>>>    <artifactId>server</artifactId>
>>>>>>>>>>>>    <version>10.3</version>
>>>>>>>>>>>> </dependency>
>>>>>>>>>>>>
>>>>>>>>>>>> You can install the weblogic.jar into your maven working copy
>>>>>>>>>>>> using:
>>>>>>>>>>>> mvn install:install-file -DgroupId=com.oracle.weblogic 
>>>>>>>>>>>> -DartifactId=server -Dfile=$WLS_HOME/server/lib/weblogic.jar 
>>>>>>>>>>>> -Dversion=10.3 -Dpackaging=jar
>>>>>>>>>>>>
>>>>>>>>>>>> Could you make a try adding the weblogic.jar into the SU ?
>>>>>>>>>>>>
>>>>>>>>>>>> Regards
>>>>>>>>>>>> JB
>>>>>>>>>>>>
>>>>>>>>>>>> laolong wrote:
>>>>>>>>>>>>>  Hi JB,
>>>>>>>>>>>>>     
>>>>>>>>>>>>>      http://www.nabble.com/file/p23978791/demo.zip demo.zip 
>>>>>>>>>>>>>
>>>>>>>>>>>>>     I built a test EJB but got same error again, all java code
>>>>>>>>>>>>> and
>>>>>>>>>>>>> bean
>>>>>>>>>>>>> defination are in attached, could you please review it?
>>>>>>>>>>>>>     
>>>>>>>>>>>>>     I'm sorry that cannot find a way to send email with
>>>>>>>>>>>>> attachement
>>>>>>>>>>>>> to
>>>>>>>>>>>>> you
>>>>>>>>>>>>> alone, so I have to use 'Reply' page to upload the file.
>>>>>>>>>>>>>
>>>>>>>>>>>>>    Thanks a lot.
>>>>>>>>>>>>>
>>>>>>>>>>>>> Long  
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> Hummm, weird.
>>>>>>>>>>>>>
>>>>>>>>>>>>> Could you provide the annotate in the your LoginService class
>>>>>>>>>>>>> (and
>>>>>>>>>>>>> the 
>>>>>>>>>>>>> corresponding interface) ?
>>>>>>>>>>>>> It looks like that the CXF-SE side is not deployed correctly
>>>>>>>>>>>>> (and
>>>>>>>>>>>>> so
>>>>>>>>>>>>> the 
>>>>>>>>>>>>> HTTP component can't find it).
>>>>>>>>>>>>> Have you all EJB proxy requirements present in your SU zip
>>>>>>>>>>>>> (EJBs
>>>>>>>>>>>>> stub, 
>>>>>>>>>>>>> etc) ?
>>>>>>>>>>>>> Is it possible to provide your cxf-se zip file (only to my, not
>>>>>>>>>>>>> on
>>>>>>>>>>>>> the 
>>>>>>>>>>>>> mailing list) ?
>>>>>>>>>>>>>
>>>>>>>>>>>>> Regards
>>>>>>>>>>>>> JB
>>
> 

Re: How to invoke EJB and How to disable WSDL validation in http:soap-consumer/provider?

Posted by laolong <le...@sina.com>.

Hi JB,

   You are right, HttpSoapConsumerMarshaler doesn't support GET method,
actually, I use POST method to send data but it's changed to 'GET' in SMX
log(caused by a missing slash in request url), so I rewrite my own
SoapConsumerMarshaler class extends original HttpSoapConsumerMarshaler to
make the 'fake' GET method work :) 

 headers.put(HttpConstants.REQUEST_METHOD, "POST"); 
 // if (HttpConstants.METHOD_POST.equals(method) 
 // || HttpConstants.METHOD_PUT.equals(method)) { 
    msg.setContent(InputStream.class, request.getInputStream()); 
 // } 

   Then I found Jetty(or http component?) would set the request method to
GET when the service url isn't end with slash(/) even if client use POST.

   I can use POST method now, and in fact, we don't need to do GET.

 Thanks a lot!

Regards
Long


Jean-Baptiste Onofré wrote:
> 
> Hi Long,
> 
> Let me check in the HTTP component how the validateWsdl attribute works.
> Nevertheless, could you confirm that you can use both GET and POST 
> method or do you still have an issue on one of the method ?
> 
> Regards
> JB
> 
> laolong wrote:
>> 
>> Hi JB,
>> 
>>    GET works just when I remove RequestMethod checking, so there is no
>> problem in http component. Anyway, now the ejb proxy is working, but
>> another
>> open issue is the http:soap-consumer still need a valid WSDL file since
>> both
>> validateWsdl='no' and validateWsdl='false' are not effective, could you
>> help
>> to check if this flag is working on your side?
>> 
>> Thanks,
>> Long
>> 
>> 
>> Jean-Baptiste Onofré wrote:
>>> In fact, I'm suprised that it works in GET :)
>>> Regarding the code, it should work only in POST :)
>>>
>>> Could make both test and send me the corresponding logs ?
>>>
>>> Thanks,
>>> Regards
>>> JB
>>>
>>> laolong wrote:
>>>> Hi JB,
>>>>
>>>>    GET is OK, but most of SOAP messges should be sent using POST, how
>>>> can
>>>> I
>>>> make POST method working within http component? or I have to use Tomcat
>>>> instead of Jetty?
>>>>
>>>> Thanks,
>>>> Long
>>>>
>>>>
>>>> Jean-Baptiste Onofré wrote:
>>>>> Yes,
>>>>>
>>>>> I think that if you make a HTTP request using GET method, it should
>>>>> work.
>>>>>
>>>>> Regards
>>>>> JB
>>>>>
>>>>> laolong wrote:
>>>>>> Hi JB,
>>>>>>
>>>>>>    Now I believe the problem is caused by HTTP component/Jetty issue,
>>>>>> the
>>>>>> HTTP component cannot get POST data from HTTP request.  
>>>>>>    1. I create a SOAP marshaler and overwrite function createExchange
>>>>>> using
>>>>>> the source code from
>>>>>> org.apache.servicemix.http.endpoints.HttpSoapConsumerMarshaler.java
>>>>>> like
>>>>>> below and remove REQUESt method checking (in red), then I can get
>>>>>> correct
>>>>>> SOAP response from XMLSpy.
>>>>>>
>>>>>> public MessageExchange createExchange(HttpServletRequest request,
>>>>>> 			ComponentContext context) throws Exception {
>>>>>> 		String method = request.getMethod();
>>>>>> 		System.out.println(method);
>>>>>> 		Message msg = super.getBinding().createMessage();
>>>>>> 		msg.put(ComponentContext.class, context);
>>>>>> 		msg.put(JbiConstants.USE_JBI_WRAPPER, super.isUseJbiWrapper());
>>>>>> 		msg.put(Message.CONTENT_TYPE, request.getContentType());
>>>>>> 		Map<String, String> headers = msg.getTransportHeaders();
>>>>>> 		for (Enumeration<?> e = request.getHeaderNames();
>>>>>> e.hasMoreElements();)
>>>>>> {
>>>>>> 			String name = (String) e.nextElement();
>>>>>> 			String value = request.getHeader(name);
>>>>>> 			headers.put(name, value);
>>>>>> 		}
>>>>>> 		headers.put(HttpConstants.REQUEST_URI, request.getRequestURL()
>>>>>> 				.toString());
>>>>>> 		headers.put(HttpConstants.CONTENT_TYPE, request.getContentType());
>>>>>> 		headers.put(HttpConstants.REQUEST_METHOD, method);
>>>>>> //		if (HttpConstants.METHOD_POST.equals(method)
>>>>>> //				|| HttpConstants.METHOD_PUT.equals(method)) {
>>>>>> 			msg.setContent(InputStream.class, request.getInputStream());
>>>>>> //		}
>>>>>> 		request.setAttribute(Message.class.getName(), msg);
>>>>>> 		InterceptorChain phase = getChain(Phase.ServerIn);
>>>>>> 		phase.doIntercept(msg);
>>>>>> 		return msg.getContent(MessageExchange.class);
>>>>>>
>>>>>> 	}
>>>>>>    2. I also tried to use <http:endpoint>, it also get following
>>>>>> error
>>>>>> message
>>>>>>
>>>>>>    <pre>org.apache.cxf.interceptor.Fault: no jbi message element
>>>>>> 	at
>>>>>> org.apache.cxf.binding.jbi.interceptor.JBIWrapperInInterceptor.handleMessage(JBIWrapperInInterceptor.java:102)
>>>>>> 	at
>>>>>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
>>>>>> 	at
>>>>>> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:89)
>>>>>> 	at
>>>>>> org.apache.cxf.transport.jbi.JBIDispatcherUtil.dispatch(JBIDispatcherUtil.java:156)
>>>>>> 	at
>>>>>> org.apache.servicemix.cxfse.CxfSeEndpoint.process(CxfSeEndpoint.java:364)
>>>>>> 	at
>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:627)
>>>>>> 	at
>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:581)
>>>>>> 	at
>>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:535)
>>>>>> 	at
>>>>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>>>>>> 	at
>>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:623)
>>>>>> 	at
>>>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>>>>>> 	at
>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>>>>>> 	at
>>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>>>>> 	at
>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
>>>>>> 	at
>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
>>>>>> 	at java.lang.Thread.run(Thread.java:595)
>>>>>> </pre>
>>>>>>
>>>>>>
>>>>>> Thanks.
>>>>>> Long
>>>>>>
>>>>>>
>>>>>>
>>>>>> Jean-Baptiste Onofré wrote:
>>>>>>> OK,
>>>>>>>
>>>>>>> The NullPointerException is raised into the Soap marshaler.
>>>>>>>
>>>>>>> Could you make a quick test using the "old" HTTP endpoint like this:
>>>>>>>     <http:endpoint service="service"
>>>>>>>                    endpoint="http"
>>>>>>>                    role="consumer"
>>>>>>>                    targetService="service"
>>>>>>>                    targetEndpoint="ejb"
>>>>>>>                    locationURI="http://0.0.0.0:8181/what/you/want"
>>>>>>>                   
>>>>>>> defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
>>>>>>>                    soap="true"
>>>>>>>                    />
>>>>>>>
>>>>>>> During this time, I take a look on the interceptor usage in the
>>>>>>> default 
>>>>>>> SOAP marshaler.
>>>>>>>
>>>>>>> Regards
>>>>>>> JB
>>>>>>>
>>>>>>> laolong wrote:
>>>>>>>> Hi JB,
>>>>>>>>    Yes, I think CXF-SU internal endpoint should be working.
>>>>>>>>    I tried servicemix-http-2009.01.0.1-fuse-installer.zip (FUSE
>>>>>>>> 3.4.0.2)
>>>>>>>> and
>>>>>>>> servicemix-http-2008.01-installer.zip(Servicemix3.3) , got same
>>>>>>>> 'InputStream
>>>>>>>> content not found' error.
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> Long
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Jean-Baptiste Onofré wrote:
>>>>>>>>> If you can get the WSDL generated by CXF, the CXF-SU should be OK.
>>>>>>>>>
>>>>>>>>> I'm going to check in the HTTP component source code where is
>>>>>>>>> raised
>>>>>>>>> the 
>>>>>>>>>   NullPointerException.
>>>>>>>>> What's the version of the HTTP component that you use ?
>>>>>>>>>
>>>>>>>>> Regards
>>>>>>>>> JB
>>>>>>>>>
>>>>>>>>> laolong wrote:
>>>>>>>>>>  I guess the problem also caused by Http/Jetty issue, the request
>>>>>>>>>> message
>>>>>>>>>> cannot be processed, message content is lost due to the SOAP
>>>>>>>>>> message
>>>>>>>>>> POST
>>>>>>>>>> by
>>>>>>>>>> XMLSpy is received with wrong method 'GET'
>>>>>>>>>>
>>>>>>>>>> SMX log---------------------------------------------
>>>>>>>>>>
>>>>>>>>>> DEBUG - HttpComponent                  - Receiving HTTP request:
>>>>>>>>>> GET
>>>>>>>>>> /LoginServiceService/main.wsdl HTTP/1.1
>>>>>>>>>> Accept: */*
>>>>>>>>>> User-Agent: XML Spy
>>>>>>>>>> Host: bjc-d-xp:8199
>>>>>>>>>> Connection: Keep-Alive
>>>>>>>>>> Cache-Control: no-cache
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> DEBUG - JettyContextManager            - Dispatching job:
>>>>>>>>>> SCEP@10234051[d=true,io=0,w=true,b=false|false]
>>>>>>>>>> DEBUG - JettyContextManager            - Dispatching job:
>>>>>>>>>> SCEP@10234051[d=true,io=1,w=true,b=false|false]
>>>>>>>>>> DEBUG - JettyContextManager            - Dispatching job:
>>>>>>>>>> SCEP@10234051[d=true,io=1,w=true,b=false|false]
>>>>>>>>>> DEBUG - HttpComponent                  - Receiving HTTP request:
>>>>>>>>>> GET
>>>>>>>>>> /LoginServiceService/ HTTP/1.1
>>>>>>>>>> User-Agent: XML Spy
>>>>>>>>>> SOAPAction: "urn:Login"
>>>>>>>>>> Host: localhost:8199
>>>>>>>>>> Connection: Keep-Alive
>>>>>>>>>> Cache-Control: no-cache
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage
>>>>>>>>>> on
>>>>>>>>>> interceptor
>>>>>>>>>> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor
>>>>>>>>>> INFO  - PhaseInterceptorChain          - Interceptor has thrown
>>>>>>>>>> exception,
>>>>>>>>>> unwinding now
>>>>>>>>>> java.lang.NullPointerException: InputStream content not found
>>>>>>>>>> 	at
>>>>>>>>>> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor.handleMessage(AttachmentsInInterceptor.java:46)
>>>>>>>>>> 	at
>>>>>>>>>> org.apache.servicemix.soap.core.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:85)
>>>>>>>>>> 	at
>>>>>>>>>> org.apache.servicemix.http.endpoints.HttpSoapConsumerMarshaler.createExchange(HttpSoapConsumerMarshaler.java:107)
>>>>>>>>>> 	at
>>>>>>>>>> org.apache.servicemix.http.endpoints.HttpConsumerEndpoint.createExchange(HttpConsumerEndpoint.java:488)
>>>>>>>>>> 	at
>>>>>>>>>> org.apache.servicemix.http.endpoints.HttpConsumerEndpoint.process(HttpConsumerEndpoint.java:293)
>>>>>>>>>> 	at
>>>>>>>>>> org.apache.servicemix.http.HttpBridgeServlet.service(HttpBridgeServlet.java:56)
>>>>>>>>>> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
>>>>>>>>>> 	at
>>>>>>>>>> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
>>>>>>>>>> 	at
>>>>>>>>>> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:363)
>>>>>>>>>> 	at
>>>>>>>>>> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
>>>>>>>>>> 	at
>>>>>>>>>> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
>>>>>>>>>> 	at
>>>>>>>>>> org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
>>>>>>>>>> 	at
>>>>>>>>>> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
>>>>>>>>>> 	at org.mortbay.jetty.Server.handle(Server.java:324)
>>>>>>>>>> 	at
>>>>>>>>>> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534)
>>>>>>>>>> 	at
>>>>>>>>>> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:864)
>>>>>>>>>> 	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:533)
>>>>>>>>>> 	at
>>>>>>>>>> org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:207)
>>>>>>>>>> 	at
>>>>>>>>>> org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:403)
>>>>>>>>>> 	at
>>>>>>>>>> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
>>>>>>>>>> 	at
>>>>>>>>>> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:522)
>>>>>>>>>> DEBUG - PhaseInterceptorChain          - Invoking handleFault on
>>>>>>>>>> interceptor
>>>>>>>>>> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor
>>>>>>>>>> DEBUG - HttpSoapConsumerMarshaler      - Using default response
>>>>>>>>>> content
>>>>>>>>>> encoding.
>>>>>>>>>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage
>>>>>>>>>> on
>>>>>>>>>> interceptor
>>>>>>>>>> org.apache.servicemix.soap.interceptors.xml.StaxOutInterceptor
>>>>>>>>>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage
>>>>>>>>>> on
>>>>>>>>>> interceptor
>>>>>>>>>> org.apache.servicemix.soap.bindings.soap.interceptors.SoapOutInterceptor
>>>>>>>>>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage
>>>>>>>>>> on
>>>>>>>>>> interceptor
>>>>>>>>>> org.apache.servicemix.soap.bindings.soap.interceptors.SoapFaultOutInterceptor
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Jean-Baptiste Onofré wrote:
>>>>>>>>>>> Hi Long,
>>>>>>>>>>>
>>>>>>>>>>> In your CXF-SE xbean.xml, I see that you try to make the JNDI
>>>>>>>>>>> lookup
>>>>>>>>>>> on 
>>>>>>>>>>> a Weblogic application server.
>>>>>>>>>>>
>>>>>>>>>>> Nevertheless, I can't see the weblogic.jar file into your SU lib
>>>>>>>>>>> directory.
>>>>>>>>>>>
>>>>>>>>>>> To be able to make JNDI lookup and RMI-IIOP, you need the
>>>>>>>>>>> weblogic 
>>>>>>>>>>> client lib.
>>>>>>>>>>>
>>>>>>>>>>> In your pom.xml, you should have a dependency like this:
>>>>>>>>>>>
>>>>>>>>>>> <dependency>
>>>>>>>>>>>    <groupId>com.oracle.weblogic</groupId>
>>>>>>>>>>>    <artifactId>server</artifactId>
>>>>>>>>>>>    <version>10.3</version>
>>>>>>>>>>> </dependency>
>>>>>>>>>>>
>>>>>>>>>>> You can install the weblogic.jar into your maven working copy
>>>>>>>>>>> using:
>>>>>>>>>>> mvn install:install-file -DgroupId=com.oracle.weblogic 
>>>>>>>>>>> -DartifactId=server -Dfile=$WLS_HOME/server/lib/weblogic.jar 
>>>>>>>>>>> -Dversion=10.3 -Dpackaging=jar
>>>>>>>>>>>
>>>>>>>>>>> Could you make a try adding the weblogic.jar into the SU ?
>>>>>>>>>>>
>>>>>>>>>>> Regards
>>>>>>>>>>> JB
>>>>>>>>>>>
>>>>>>>>>>> laolong wrote:
>>>>>>>>>>>>  Hi JB,
>>>>>>>>>>>>     
>>>>>>>>>>>>      http://www.nabble.com/file/p23978791/demo.zip demo.zip 
>>>>>>>>>>>>
>>>>>>>>>>>>     I built a test EJB but got same error again, all java code
>>>>>>>>>>>> and
>>>>>>>>>>>> bean
>>>>>>>>>>>> defination are in attached, could you please review it?
>>>>>>>>>>>>     
>>>>>>>>>>>>     I'm sorry that cannot find a way to send email with
>>>>>>>>>>>> attachement
>>>>>>>>>>>> to
>>>>>>>>>>>> you
>>>>>>>>>>>> alone, so I have to use 'Reply' page to upload the file.
>>>>>>>>>>>>
>>>>>>>>>>>>    Thanks a lot.
>>>>>>>>>>>>
>>>>>>>>>>>> Long  
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Hummm, weird.
>>>>>>>>>>>>
>>>>>>>>>>>> Could you provide the annotate in the your LoginService class
>>>>>>>>>>>> (and
>>>>>>>>>>>> the 
>>>>>>>>>>>> corresponding interface) ?
>>>>>>>>>>>> It looks like that the CXF-SE side is not deployed correctly
>>>>>>>>>>>> (and
>>>>>>>>>>>> so
>>>>>>>>>>>> the 
>>>>>>>>>>>> HTTP component can't find it).
>>>>>>>>>>>> Have you all EJB proxy requirements present in your SU zip
>>>>>>>>>>>> (EJBs
>>>>>>>>>>>> stub, 
>>>>>>>>>>>> etc) ?
>>>>>>>>>>>> Is it possible to provide your cxf-se zip file (only to my, not
>>>>>>>>>>>> on
>>>>>>>>>>>> the 
>>>>>>>>>>>> mailing list) ?
>>>>>>>>>>>>
>>>>>>>>>>>> Regards
>>>>>>>>>>>> JB
>>>
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-invoke-EJB-and-How-to-disable-WSDL-validation-in-http%3Asoap-consumer-provider--tp23963883p23999681.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: How to invoke EJB and How to disable WSDL validation in http:soap-consumer/provider?

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Long,

Let me check in the HTTP component how the validateWsdl attribute works.
Nevertheless, could you confirm that you can use both GET and POST 
method or do you still have an issue on one of the method ?

Regards
JB

laolong wrote:
> 
> Hi JB,
> 
>    GET works just when I remove RequestMethod checking, so there is no
> problem in http component. Anyway, now the ejb proxy is working, but another
> open issue is the http:soap-consumer still need a valid WSDL file since both
> validateWsdl='no' and validateWsdl='false' are not effective, could you help
> to check if this flag is working on your side?
> 
> Thanks,
> Long
> 
> 
> Jean-Baptiste Onofré wrote:
>> In fact, I'm suprised that it works in GET :)
>> Regarding the code, it should work only in POST :)
>>
>> Could make both test and send me the corresponding logs ?
>>
>> Thanks,
>> Regards
>> JB
>>
>> laolong wrote:
>>> Hi JB,
>>>
>>>    GET is OK, but most of SOAP messges should be sent using POST, how can
>>> I
>>> make POST method working within http component? or I have to use Tomcat
>>> instead of Jetty?
>>>
>>> Thanks,
>>> Long
>>>
>>>
>>> Jean-Baptiste Onofré wrote:
>>>> Yes,
>>>>
>>>> I think that if you make a HTTP request using GET method, it should
>>>> work.
>>>>
>>>> Regards
>>>> JB
>>>>
>>>> laolong wrote:
>>>>> Hi JB,
>>>>>
>>>>>    Now I believe the problem is caused by HTTP component/Jetty issue,
>>>>> the
>>>>> HTTP component cannot get POST data from HTTP request.  
>>>>>    1. I create a SOAP marshaler and overwrite function createExchange
>>>>> using
>>>>> the source code from
>>>>> org.apache.servicemix.http.endpoints.HttpSoapConsumerMarshaler.java
>>>>> like
>>>>> below and remove REQUESt method checking (in red), then I can get
>>>>> correct
>>>>> SOAP response from XMLSpy.
>>>>>
>>>>> public MessageExchange createExchange(HttpServletRequest request,
>>>>> 			ComponentContext context) throws Exception {
>>>>> 		String method = request.getMethod();
>>>>> 		System.out.println(method);
>>>>> 		Message msg = super.getBinding().createMessage();
>>>>> 		msg.put(ComponentContext.class, context);
>>>>> 		msg.put(JbiConstants.USE_JBI_WRAPPER, super.isUseJbiWrapper());
>>>>> 		msg.put(Message.CONTENT_TYPE, request.getContentType());
>>>>> 		Map<String, String> headers = msg.getTransportHeaders();
>>>>> 		for (Enumeration<?> e = request.getHeaderNames();
>>>>> e.hasMoreElements();)
>>>>> {
>>>>> 			String name = (String) e.nextElement();
>>>>> 			String value = request.getHeader(name);
>>>>> 			headers.put(name, value);
>>>>> 		}
>>>>> 		headers.put(HttpConstants.REQUEST_URI, request.getRequestURL()
>>>>> 				.toString());
>>>>> 		headers.put(HttpConstants.CONTENT_TYPE, request.getContentType());
>>>>> 		headers.put(HttpConstants.REQUEST_METHOD, method);
>>>>> //		if (HttpConstants.METHOD_POST.equals(method)
>>>>> //				|| HttpConstants.METHOD_PUT.equals(method)) {
>>>>> 			msg.setContent(InputStream.class, request.getInputStream());
>>>>> //		}
>>>>> 		request.setAttribute(Message.class.getName(), msg);
>>>>> 		InterceptorChain phase = getChain(Phase.ServerIn);
>>>>> 		phase.doIntercept(msg);
>>>>> 		return msg.getContent(MessageExchange.class);
>>>>>
>>>>> 	}
>>>>>    2. I also tried to use <http:endpoint>, it also get following error
>>>>> message
>>>>>
>>>>>    <pre>org.apache.cxf.interceptor.Fault: no jbi message element
>>>>> 	at
>>>>> org.apache.cxf.binding.jbi.interceptor.JBIWrapperInInterceptor.handleMessage(JBIWrapperInInterceptor.java:102)
>>>>> 	at
>>>>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
>>>>> 	at
>>>>> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:89)
>>>>> 	at
>>>>> org.apache.cxf.transport.jbi.JBIDispatcherUtil.dispatch(JBIDispatcherUtil.java:156)
>>>>> 	at
>>>>> org.apache.servicemix.cxfse.CxfSeEndpoint.process(CxfSeEndpoint.java:364)
>>>>> 	at
>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:627)
>>>>> 	at
>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:581)
>>>>> 	at
>>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:535)
>>>>> 	at
>>>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>>>>> 	at
>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:623)
>>>>> 	at
>>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>>>>> 	at
>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>>>>> 	at
>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>>>> 	at
>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
>>>>> 	at
>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
>>>>> 	at java.lang.Thread.run(Thread.java:595)
>>>>> </pre>
>>>>>
>>>>>
>>>>> Thanks.
>>>>> Long
>>>>>
>>>>>
>>>>>
>>>>> Jean-Baptiste Onofré wrote:
>>>>>> OK,
>>>>>>
>>>>>> The NullPointerException is raised into the Soap marshaler.
>>>>>>
>>>>>> Could you make a quick test using the "old" HTTP endpoint like this:
>>>>>>     <http:endpoint service="service"
>>>>>>                    endpoint="http"
>>>>>>                    role="consumer"
>>>>>>                    targetService="service"
>>>>>>                    targetEndpoint="ejb"
>>>>>>                    locationURI="http://0.0.0.0:8181/what/you/want"
>>>>>>                    defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
>>>>>>                    soap="true"
>>>>>>                    />
>>>>>>
>>>>>> During this time, I take a look on the interceptor usage in the
>>>>>> default 
>>>>>> SOAP marshaler.
>>>>>>
>>>>>> Regards
>>>>>> JB
>>>>>>
>>>>>> laolong wrote:
>>>>>>> Hi JB,
>>>>>>>    Yes, I think CXF-SU internal endpoint should be working.
>>>>>>>    I tried servicemix-http-2009.01.0.1-fuse-installer.zip (FUSE
>>>>>>> 3.4.0.2)
>>>>>>> and
>>>>>>> servicemix-http-2008.01-installer.zip(Servicemix3.3) , got same
>>>>>>> 'InputStream
>>>>>>> content not found' error.
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Long
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Jean-Baptiste Onofré wrote:
>>>>>>>> If you can get the WSDL generated by CXF, the CXF-SU should be OK.
>>>>>>>>
>>>>>>>> I'm going to check in the HTTP component source code where is raised
>>>>>>>> the 
>>>>>>>>   NullPointerException.
>>>>>>>> What's the version of the HTTP component that you use ?
>>>>>>>>
>>>>>>>> Regards
>>>>>>>> JB
>>>>>>>>
>>>>>>>> laolong wrote:
>>>>>>>>>  I guess the problem also caused by Http/Jetty issue, the request
>>>>>>>>> message
>>>>>>>>> cannot be processed, message content is lost due to the SOAP
>>>>>>>>> message
>>>>>>>>> POST
>>>>>>>>> by
>>>>>>>>> XMLSpy is received with wrong method 'GET'
>>>>>>>>>
>>>>>>>>> SMX log---------------------------------------------
>>>>>>>>>
>>>>>>>>> DEBUG - HttpComponent                  - Receiving HTTP request:
>>>>>>>>> GET
>>>>>>>>> /LoginServiceService/main.wsdl HTTP/1.1
>>>>>>>>> Accept: */*
>>>>>>>>> User-Agent: XML Spy
>>>>>>>>> Host: bjc-d-xp:8199
>>>>>>>>> Connection: Keep-Alive
>>>>>>>>> Cache-Control: no-cache
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> DEBUG - JettyContextManager            - Dispatching job:
>>>>>>>>> SCEP@10234051[d=true,io=0,w=true,b=false|false]
>>>>>>>>> DEBUG - JettyContextManager            - Dispatching job:
>>>>>>>>> SCEP@10234051[d=true,io=1,w=true,b=false|false]
>>>>>>>>> DEBUG - JettyContextManager            - Dispatching job:
>>>>>>>>> SCEP@10234051[d=true,io=1,w=true,b=false|false]
>>>>>>>>> DEBUG - HttpComponent                  - Receiving HTTP request:
>>>>>>>>> GET
>>>>>>>>> /LoginServiceService/ HTTP/1.1
>>>>>>>>> User-Agent: XML Spy
>>>>>>>>> SOAPAction: "urn:Login"
>>>>>>>>> Host: localhost:8199
>>>>>>>>> Connection: Keep-Alive
>>>>>>>>> Cache-Control: no-cache
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
>>>>>>>>> interceptor
>>>>>>>>> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor
>>>>>>>>> INFO  - PhaseInterceptorChain          - Interceptor has thrown
>>>>>>>>> exception,
>>>>>>>>> unwinding now
>>>>>>>>> java.lang.NullPointerException: InputStream content not found
>>>>>>>>> 	at
>>>>>>>>> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor.handleMessage(AttachmentsInInterceptor.java:46)
>>>>>>>>> 	at
>>>>>>>>> org.apache.servicemix.soap.core.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:85)
>>>>>>>>> 	at
>>>>>>>>> org.apache.servicemix.http.endpoints.HttpSoapConsumerMarshaler.createExchange(HttpSoapConsumerMarshaler.java:107)
>>>>>>>>> 	at
>>>>>>>>> org.apache.servicemix.http.endpoints.HttpConsumerEndpoint.createExchange(HttpConsumerEndpoint.java:488)
>>>>>>>>> 	at
>>>>>>>>> org.apache.servicemix.http.endpoints.HttpConsumerEndpoint.process(HttpConsumerEndpoint.java:293)
>>>>>>>>> 	at
>>>>>>>>> org.apache.servicemix.http.HttpBridgeServlet.service(HttpBridgeServlet.java:56)
>>>>>>>>> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
>>>>>>>>> 	at
>>>>>>>>> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
>>>>>>>>> 	at
>>>>>>>>> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:363)
>>>>>>>>> 	at
>>>>>>>>> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
>>>>>>>>> 	at
>>>>>>>>> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
>>>>>>>>> 	at
>>>>>>>>> org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
>>>>>>>>> 	at
>>>>>>>>> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
>>>>>>>>> 	at org.mortbay.jetty.Server.handle(Server.java:324)
>>>>>>>>> 	at
>>>>>>>>> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534)
>>>>>>>>> 	at
>>>>>>>>> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:864)
>>>>>>>>> 	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:533)
>>>>>>>>> 	at
>>>>>>>>> org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:207)
>>>>>>>>> 	at
>>>>>>>>> org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:403)
>>>>>>>>> 	at
>>>>>>>>> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
>>>>>>>>> 	at
>>>>>>>>> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:522)
>>>>>>>>> DEBUG - PhaseInterceptorChain          - Invoking handleFault on
>>>>>>>>> interceptor
>>>>>>>>> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor
>>>>>>>>> DEBUG - HttpSoapConsumerMarshaler      - Using default response
>>>>>>>>> content
>>>>>>>>> encoding.
>>>>>>>>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
>>>>>>>>> interceptor
>>>>>>>>> org.apache.servicemix.soap.interceptors.xml.StaxOutInterceptor
>>>>>>>>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
>>>>>>>>> interceptor
>>>>>>>>> org.apache.servicemix.soap.bindings.soap.interceptors.SoapOutInterceptor
>>>>>>>>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
>>>>>>>>> interceptor
>>>>>>>>> org.apache.servicemix.soap.bindings.soap.interceptors.SoapFaultOutInterceptor
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Jean-Baptiste Onofré wrote:
>>>>>>>>>> Hi Long,
>>>>>>>>>>
>>>>>>>>>> In your CXF-SE xbean.xml, I see that you try to make the JNDI
>>>>>>>>>> lookup
>>>>>>>>>> on 
>>>>>>>>>> a Weblogic application server.
>>>>>>>>>>
>>>>>>>>>> Nevertheless, I can't see the weblogic.jar file into your SU lib
>>>>>>>>>> directory.
>>>>>>>>>>
>>>>>>>>>> To be able to make JNDI lookup and RMI-IIOP, you need the weblogic 
>>>>>>>>>> client lib.
>>>>>>>>>>
>>>>>>>>>> In your pom.xml, you should have a dependency like this:
>>>>>>>>>>
>>>>>>>>>> <dependency>
>>>>>>>>>>    <groupId>com.oracle.weblogic</groupId>
>>>>>>>>>>    <artifactId>server</artifactId>
>>>>>>>>>>    <version>10.3</version>
>>>>>>>>>> </dependency>
>>>>>>>>>>
>>>>>>>>>> You can install the weblogic.jar into your maven working copy
>>>>>>>>>> using:
>>>>>>>>>> mvn install:install-file -DgroupId=com.oracle.weblogic 
>>>>>>>>>> -DartifactId=server -Dfile=$WLS_HOME/server/lib/weblogic.jar 
>>>>>>>>>> -Dversion=10.3 -Dpackaging=jar
>>>>>>>>>>
>>>>>>>>>> Could you make a try adding the weblogic.jar into the SU ?
>>>>>>>>>>
>>>>>>>>>> Regards
>>>>>>>>>> JB
>>>>>>>>>>
>>>>>>>>>> laolong wrote:
>>>>>>>>>>>  Hi JB,
>>>>>>>>>>>     
>>>>>>>>>>>      http://www.nabble.com/file/p23978791/demo.zip demo.zip 
>>>>>>>>>>>
>>>>>>>>>>>     I built a test EJB but got same error again, all java code
>>>>>>>>>>> and
>>>>>>>>>>> bean
>>>>>>>>>>> defination are in attached, could you please review it?
>>>>>>>>>>>     
>>>>>>>>>>>     I'm sorry that cannot find a way to send email with
>>>>>>>>>>> attachement
>>>>>>>>>>> to
>>>>>>>>>>> you
>>>>>>>>>>> alone, so I have to use 'Reply' page to upload the file.
>>>>>>>>>>>
>>>>>>>>>>>    Thanks a lot.
>>>>>>>>>>>
>>>>>>>>>>> Long  
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Hummm, weird.
>>>>>>>>>>>
>>>>>>>>>>> Could you provide the annotate in the your LoginService class
>>>>>>>>>>> (and
>>>>>>>>>>> the 
>>>>>>>>>>> corresponding interface) ?
>>>>>>>>>>> It looks like that the CXF-SE side is not deployed correctly (and
>>>>>>>>>>> so
>>>>>>>>>>> the 
>>>>>>>>>>> HTTP component can't find it).
>>>>>>>>>>> Have you all EJB proxy requirements present in your SU zip (EJBs
>>>>>>>>>>> stub, 
>>>>>>>>>>> etc) ?
>>>>>>>>>>> Is it possible to provide your cxf-se zip file (only to my, not
>>>>>>>>>>> on
>>>>>>>>>>> the 
>>>>>>>>>>> mailing list) ?
>>>>>>>>>>>
>>>>>>>>>>> Regards
>>>>>>>>>>> JB
>>
> 

Re: How to invoke EJB and How to disable WSDL validation in http:soap-consumer/provider?

Posted by laolong <le...@sina.com>.

Hi JB,

   GET works just when I remove RequestMethod checking, so there is no
problem in http component. Anyway, now the ejb proxy is working, but another
open issue is the http:soap-consumer still need a valid WSDL file since both
validateWsdl='no' and validateWsdl='false' are not effective, could you help
to check if this flag is working on your side?

Thanks,
Long


Jean-Baptiste Onofré wrote:
> 
> In fact, I'm suprised that it works in GET :)
> Regarding the code, it should work only in POST :)
> 
> Could make both test and send me the corresponding logs ?
> 
> Thanks,
> Regards
> JB
> 
> laolong wrote:
>> 
>> Hi JB,
>> 
>>    GET is OK, but most of SOAP messges should be sent using POST, how can
>> I
>> make POST method working within http component? or I have to use Tomcat
>> instead of Jetty?
>> 
>> Thanks,
>> Long
>> 
>> 
>> Jean-Baptiste Onofré wrote:
>>> Yes,
>>>
>>> I think that if you make a HTTP request using GET method, it should
>>> work.
>>>
>>> Regards
>>> JB
>>>
>>> laolong wrote:
>>>> Hi JB,
>>>>
>>>>    Now I believe the problem is caused by HTTP component/Jetty issue,
>>>> the
>>>> HTTP component cannot get POST data from HTTP request.  
>>>>    1. I create a SOAP marshaler and overwrite function createExchange
>>>> using
>>>> the source code from
>>>> org.apache.servicemix.http.endpoints.HttpSoapConsumerMarshaler.java
>>>> like
>>>> below and remove REQUESt method checking (in red), then I can get
>>>> correct
>>>> SOAP response from XMLSpy.
>>>>
>>>> public MessageExchange createExchange(HttpServletRequest request,
>>>> 			ComponentContext context) throws Exception {
>>>> 		String method = request.getMethod();
>>>> 		System.out.println(method);
>>>> 		Message msg = super.getBinding().createMessage();
>>>> 		msg.put(ComponentContext.class, context);
>>>> 		msg.put(JbiConstants.USE_JBI_WRAPPER, super.isUseJbiWrapper());
>>>> 		msg.put(Message.CONTENT_TYPE, request.getContentType());
>>>> 		Map<String, String> headers = msg.getTransportHeaders();
>>>> 		for (Enumeration<?> e = request.getHeaderNames();
>>>> e.hasMoreElements();)
>>>> {
>>>> 			String name = (String) e.nextElement();
>>>> 			String value = request.getHeader(name);
>>>> 			headers.put(name, value);
>>>> 		}
>>>> 		headers.put(HttpConstants.REQUEST_URI, request.getRequestURL()
>>>> 				.toString());
>>>> 		headers.put(HttpConstants.CONTENT_TYPE, request.getContentType());
>>>> 		headers.put(HttpConstants.REQUEST_METHOD, method);
>>>> //		if (HttpConstants.METHOD_POST.equals(method)
>>>> //				|| HttpConstants.METHOD_PUT.equals(method)) {
>>>> 			msg.setContent(InputStream.class, request.getInputStream());
>>>> //		}
>>>> 		request.setAttribute(Message.class.getName(), msg);
>>>> 		InterceptorChain phase = getChain(Phase.ServerIn);
>>>> 		phase.doIntercept(msg);
>>>> 		return msg.getContent(MessageExchange.class);
>>>>
>>>> 	}
>>>>    2. I also tried to use <http:endpoint>, it also get following error
>>>> message
>>>>
>>>>    <pre>org.apache.cxf.interceptor.Fault: no jbi message element
>>>> 	at
>>>> org.apache.cxf.binding.jbi.interceptor.JBIWrapperInInterceptor.handleMessage(JBIWrapperInInterceptor.java:102)
>>>> 	at
>>>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
>>>> 	at
>>>> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:89)
>>>> 	at
>>>> org.apache.cxf.transport.jbi.JBIDispatcherUtil.dispatch(JBIDispatcherUtil.java:156)
>>>> 	at
>>>> org.apache.servicemix.cxfse.CxfSeEndpoint.process(CxfSeEndpoint.java:364)
>>>> 	at
>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:627)
>>>> 	at
>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:581)
>>>> 	at
>>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:535)
>>>> 	at
>>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>>>> 	at
>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:623)
>>>> 	at
>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>>>> 	at
>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>>>> 	at
>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>>> 	at
>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
>>>> 	at
>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
>>>> 	at java.lang.Thread.run(Thread.java:595)
>>>> </pre>
>>>>
>>>>
>>>> Thanks.
>>>> Long
>>>>
>>>>
>>>>
>>>> Jean-Baptiste Onofré wrote:
>>>>> OK,
>>>>>
>>>>> The NullPointerException is raised into the Soap marshaler.
>>>>>
>>>>> Could you make a quick test using the "old" HTTP endpoint like this:
>>>>>     <http:endpoint service="service"
>>>>>                    endpoint="http"
>>>>>                    role="consumer"
>>>>>                    targetService="service"
>>>>>                    targetEndpoint="ejb"
>>>>>                    locationURI="http://0.0.0.0:8181/what/you/want"
>>>>>                    defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
>>>>>                    soap="true"
>>>>>                    />
>>>>>
>>>>> During this time, I take a look on the interceptor usage in the
>>>>> default 
>>>>> SOAP marshaler.
>>>>>
>>>>> Regards
>>>>> JB
>>>>>
>>>>> laolong wrote:
>>>>>> Hi JB,
>>>>>>    Yes, I think CXF-SU internal endpoint should be working.
>>>>>>    I tried servicemix-http-2009.01.0.1-fuse-installer.zip (FUSE
>>>>>> 3.4.0.2)
>>>>>> and
>>>>>> servicemix-http-2008.01-installer.zip(Servicemix3.3) , got same
>>>>>> 'InputStream
>>>>>> content not found' error.
>>>>>>
>>>>>> Thanks,
>>>>>> Long
>>>>>>
>>>>>>
>>>>>>
>>>>>> Jean-Baptiste Onofré wrote:
>>>>>>> If you can get the WSDL generated by CXF, the CXF-SU should be OK.
>>>>>>>
>>>>>>> I'm going to check in the HTTP component source code where is raised
>>>>>>> the 
>>>>>>>   NullPointerException.
>>>>>>> What's the version of the HTTP component that you use ?
>>>>>>>
>>>>>>> Regards
>>>>>>> JB
>>>>>>>
>>>>>>> laolong wrote:
>>>>>>>>  I guess the problem also caused by Http/Jetty issue, the request
>>>>>>>> message
>>>>>>>> cannot be processed, message content is lost due to the SOAP
>>>>>>>> message
>>>>>>>> POST
>>>>>>>> by
>>>>>>>> XMLSpy is received with wrong method 'GET'
>>>>>>>>
>>>>>>>> SMX log---------------------------------------------
>>>>>>>>
>>>>>>>> DEBUG - HttpComponent                  - Receiving HTTP request:
>>>>>>>> GET
>>>>>>>> /LoginServiceService/main.wsdl HTTP/1.1
>>>>>>>> Accept: */*
>>>>>>>> User-Agent: XML Spy
>>>>>>>> Host: bjc-d-xp:8199
>>>>>>>> Connection: Keep-Alive
>>>>>>>> Cache-Control: no-cache
>>>>>>>>
>>>>>>>>
>>>>>>>> DEBUG - JettyContextManager            - Dispatching job:
>>>>>>>> SCEP@10234051[d=true,io=0,w=true,b=false|false]
>>>>>>>> DEBUG - JettyContextManager            - Dispatching job:
>>>>>>>> SCEP@10234051[d=true,io=1,w=true,b=false|false]
>>>>>>>> DEBUG - JettyContextManager            - Dispatching job:
>>>>>>>> SCEP@10234051[d=true,io=1,w=true,b=false|false]
>>>>>>>> DEBUG - HttpComponent                  - Receiving HTTP request:
>>>>>>>> GET
>>>>>>>> /LoginServiceService/ HTTP/1.1
>>>>>>>> User-Agent: XML Spy
>>>>>>>> SOAPAction: "urn:Login"
>>>>>>>> Host: localhost:8199
>>>>>>>> Connection: Keep-Alive
>>>>>>>> Cache-Control: no-cache
>>>>>>>>
>>>>>>>>
>>>>>>>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
>>>>>>>> interceptor
>>>>>>>> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor
>>>>>>>> INFO  - PhaseInterceptorChain          - Interceptor has thrown
>>>>>>>> exception,
>>>>>>>> unwinding now
>>>>>>>> java.lang.NullPointerException: InputStream content not found
>>>>>>>> 	at
>>>>>>>> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor.handleMessage(AttachmentsInInterceptor.java:46)
>>>>>>>> 	at
>>>>>>>> org.apache.servicemix.soap.core.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:85)
>>>>>>>> 	at
>>>>>>>> org.apache.servicemix.http.endpoints.HttpSoapConsumerMarshaler.createExchange(HttpSoapConsumerMarshaler.java:107)
>>>>>>>> 	at
>>>>>>>> org.apache.servicemix.http.endpoints.HttpConsumerEndpoint.createExchange(HttpConsumerEndpoint.java:488)
>>>>>>>> 	at
>>>>>>>> org.apache.servicemix.http.endpoints.HttpConsumerEndpoint.process(HttpConsumerEndpoint.java:293)
>>>>>>>> 	at
>>>>>>>> org.apache.servicemix.http.HttpBridgeServlet.service(HttpBridgeServlet.java:56)
>>>>>>>> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
>>>>>>>> 	at
>>>>>>>> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
>>>>>>>> 	at
>>>>>>>> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:363)
>>>>>>>> 	at
>>>>>>>> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
>>>>>>>> 	at
>>>>>>>> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
>>>>>>>> 	at
>>>>>>>> org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
>>>>>>>> 	at
>>>>>>>> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
>>>>>>>> 	at org.mortbay.jetty.Server.handle(Server.java:324)
>>>>>>>> 	at
>>>>>>>> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534)
>>>>>>>> 	at
>>>>>>>> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:864)
>>>>>>>> 	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:533)
>>>>>>>> 	at
>>>>>>>> org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:207)
>>>>>>>> 	at
>>>>>>>> org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:403)
>>>>>>>> 	at
>>>>>>>> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
>>>>>>>> 	at
>>>>>>>> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:522)
>>>>>>>> DEBUG - PhaseInterceptorChain          - Invoking handleFault on
>>>>>>>> interceptor
>>>>>>>> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor
>>>>>>>> DEBUG - HttpSoapConsumerMarshaler      - Using default response
>>>>>>>> content
>>>>>>>> encoding.
>>>>>>>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
>>>>>>>> interceptor
>>>>>>>> org.apache.servicemix.soap.interceptors.xml.StaxOutInterceptor
>>>>>>>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
>>>>>>>> interceptor
>>>>>>>> org.apache.servicemix.soap.bindings.soap.interceptors.SoapOutInterceptor
>>>>>>>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
>>>>>>>> interceptor
>>>>>>>> org.apache.servicemix.soap.bindings.soap.interceptors.SoapFaultOutInterceptor
>>>>>>>>
>>>>>>>>
>>>>>>>> Jean-Baptiste Onofré wrote:
>>>>>>>>> Hi Long,
>>>>>>>>>
>>>>>>>>> In your CXF-SE xbean.xml, I see that you try to make the JNDI
>>>>>>>>> lookup
>>>>>>>>> on 
>>>>>>>>> a Weblogic application server.
>>>>>>>>>
>>>>>>>>> Nevertheless, I can't see the weblogic.jar file into your SU lib
>>>>>>>>> directory.
>>>>>>>>>
>>>>>>>>> To be able to make JNDI lookup and RMI-IIOP, you need the weblogic 
>>>>>>>>> client lib.
>>>>>>>>>
>>>>>>>>> In your pom.xml, you should have a dependency like this:
>>>>>>>>>
>>>>>>>>> <dependency>
>>>>>>>>>    <groupId>com.oracle.weblogic</groupId>
>>>>>>>>>    <artifactId>server</artifactId>
>>>>>>>>>    <version>10.3</version>
>>>>>>>>> </dependency>
>>>>>>>>>
>>>>>>>>> You can install the weblogic.jar into your maven working copy
>>>>>>>>> using:
>>>>>>>>> mvn install:install-file -DgroupId=com.oracle.weblogic 
>>>>>>>>> -DartifactId=server -Dfile=$WLS_HOME/server/lib/weblogic.jar 
>>>>>>>>> -Dversion=10.3 -Dpackaging=jar
>>>>>>>>>
>>>>>>>>> Could you make a try adding the weblogic.jar into the SU ?
>>>>>>>>>
>>>>>>>>> Regards
>>>>>>>>> JB
>>>>>>>>>
>>>>>>>>> laolong wrote:
>>>>>>>>>>  Hi JB,
>>>>>>>>>>     
>>>>>>>>>>      http://www.nabble.com/file/p23978791/demo.zip demo.zip 
>>>>>>>>>>
>>>>>>>>>>     I built a test EJB but got same error again, all java code
>>>>>>>>>> and
>>>>>>>>>> bean
>>>>>>>>>> defination are in attached, could you please review it?
>>>>>>>>>>     
>>>>>>>>>>     I'm sorry that cannot find a way to send email with
>>>>>>>>>> attachement
>>>>>>>>>> to
>>>>>>>>>> you
>>>>>>>>>> alone, so I have to use 'Reply' page to upload the file.
>>>>>>>>>>
>>>>>>>>>>    Thanks a lot.
>>>>>>>>>>
>>>>>>>>>> Long  
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Hummm, weird.
>>>>>>>>>>
>>>>>>>>>> Could you provide the annotate in the your LoginService class
>>>>>>>>>> (and
>>>>>>>>>> the 
>>>>>>>>>> corresponding interface) ?
>>>>>>>>>> It looks like that the CXF-SE side is not deployed correctly (and
>>>>>>>>>> so
>>>>>>>>>> the 
>>>>>>>>>> HTTP component can't find it).
>>>>>>>>>> Have you all EJB proxy requirements present in your SU zip (EJBs
>>>>>>>>>> stub, 
>>>>>>>>>> etc) ?
>>>>>>>>>> Is it possible to provide your cxf-se zip file (only to my, not
>>>>>>>>>> on
>>>>>>>>>> the 
>>>>>>>>>> mailing list) ?
>>>>>>>>>>
>>>>>>>>>> Regards
>>>>>>>>>> JB
>>>
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-invoke-EJB-and-How-to-disable-WSDL-validation-in-http%3Asoap-consumer-provider--tp23963883p23998501.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: How to invoke EJB and How to disable WSDL validation in http:soap-consumer/provider?

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
In fact, I'm suprised that it works in GET :)
Regarding the code, it should work only in POST :)

Could make both test and send me the corresponding logs ?

Thanks,
Regards
JB

laolong wrote:
> 
> Hi JB,
> 
>    GET is OK, but most of SOAP messges should be sent using POST, how can I
> make POST method working within http component? or I have to use Tomcat
> instead of Jetty?
> 
> Thanks,
> Long
> 
> 
> Jean-Baptiste Onofré wrote:
>> Yes,
>>
>> I think that if you make a HTTP request using GET method, it should work.
>>
>> Regards
>> JB
>>
>> laolong wrote:
>>> Hi JB,
>>>
>>>    Now I believe the problem is caused by HTTP component/Jetty issue, the
>>> HTTP component cannot get POST data from HTTP request.  
>>>    1. I create a SOAP marshaler and overwrite function createExchange
>>> using
>>> the source code from
>>> org.apache.servicemix.http.endpoints.HttpSoapConsumerMarshaler.java like
>>> below and remove REQUESt method checking (in red), then I can get correct
>>> SOAP response from XMLSpy.
>>>
>>> public MessageExchange createExchange(HttpServletRequest request,
>>> 			ComponentContext context) throws Exception {
>>> 		String method = request.getMethod();
>>> 		System.out.println(method);
>>> 		Message msg = super.getBinding().createMessage();
>>> 		msg.put(ComponentContext.class, context);
>>> 		msg.put(JbiConstants.USE_JBI_WRAPPER, super.isUseJbiWrapper());
>>> 		msg.put(Message.CONTENT_TYPE, request.getContentType());
>>> 		Map<String, String> headers = msg.getTransportHeaders();
>>> 		for (Enumeration<?> e = request.getHeaderNames(); e.hasMoreElements();)
>>> {
>>> 			String name = (String) e.nextElement();
>>> 			String value = request.getHeader(name);
>>> 			headers.put(name, value);
>>> 		}
>>> 		headers.put(HttpConstants.REQUEST_URI, request.getRequestURL()
>>> 				.toString());
>>> 		headers.put(HttpConstants.CONTENT_TYPE, request.getContentType());
>>> 		headers.put(HttpConstants.REQUEST_METHOD, method);
>>> //		if (HttpConstants.METHOD_POST.equals(method)
>>> //				|| HttpConstants.METHOD_PUT.equals(method)) {
>>> 			msg.setContent(InputStream.class, request.getInputStream());
>>> //		}
>>> 		request.setAttribute(Message.class.getName(), msg);
>>> 		InterceptorChain phase = getChain(Phase.ServerIn);
>>> 		phase.doIntercept(msg);
>>> 		return msg.getContent(MessageExchange.class);
>>>
>>> 	}
>>>    2. I also tried to use <http:endpoint>, it also get following error
>>> message
>>>
>>>    <pre>org.apache.cxf.interceptor.Fault: no jbi message element
>>> 	at
>>> org.apache.cxf.binding.jbi.interceptor.JBIWrapperInInterceptor.handleMessage(JBIWrapperInInterceptor.java:102)
>>> 	at
>>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
>>> 	at
>>> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:89)
>>> 	at
>>> org.apache.cxf.transport.jbi.JBIDispatcherUtil.dispatch(JBIDispatcherUtil.java:156)
>>> 	at
>>> org.apache.servicemix.cxfse.CxfSeEndpoint.process(CxfSeEndpoint.java:364)
>>> 	at
>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:627)
>>> 	at
>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:581)
>>> 	at
>>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:535)
>>> 	at
>>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>>> 	at
>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:623)
>>> 	at
>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>>> 	at
>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>>> 	at
>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>> 	at
>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
>>> 	at
>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
>>> 	at java.lang.Thread.run(Thread.java:595)
>>> </pre>
>>>
>>>
>>> Thanks.
>>> Long
>>>
>>>
>>>
>>> Jean-Baptiste Onofré wrote:
>>>> OK,
>>>>
>>>> The NullPointerException is raised into the Soap marshaler.
>>>>
>>>> Could you make a quick test using the "old" HTTP endpoint like this:
>>>>     <http:endpoint service="service"
>>>>                    endpoint="http"
>>>>                    role="consumer"
>>>>                    targetService="service"
>>>>                    targetEndpoint="ejb"
>>>>                    locationURI="http://0.0.0.0:8181/what/you/want"
>>>>                    defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
>>>>                    soap="true"
>>>>                    />
>>>>
>>>> During this time, I take a look on the interceptor usage in the default 
>>>> SOAP marshaler.
>>>>
>>>> Regards
>>>> JB
>>>>
>>>> laolong wrote:
>>>>> Hi JB,
>>>>>    Yes, I think CXF-SU internal endpoint should be working.
>>>>>    I tried servicemix-http-2009.01.0.1-fuse-installer.zip (FUSE
>>>>> 3.4.0.2)
>>>>> and
>>>>> servicemix-http-2008.01-installer.zip(Servicemix3.3) , got same
>>>>> 'InputStream
>>>>> content not found' error.
>>>>>
>>>>> Thanks,
>>>>> Long
>>>>>
>>>>>
>>>>>
>>>>> Jean-Baptiste Onofré wrote:
>>>>>> If you can get the WSDL generated by CXF, the CXF-SU should be OK.
>>>>>>
>>>>>> I'm going to check in the HTTP component source code where is raised
>>>>>> the 
>>>>>>   NullPointerException.
>>>>>> What's the version of the HTTP component that you use ?
>>>>>>
>>>>>> Regards
>>>>>> JB
>>>>>>
>>>>>> laolong wrote:
>>>>>>>  I guess the problem also caused by Http/Jetty issue, the request
>>>>>>> message
>>>>>>> cannot be processed, message content is lost due to the SOAP message
>>>>>>> POST
>>>>>>> by
>>>>>>> XMLSpy is received with wrong method 'GET'
>>>>>>>
>>>>>>> SMX log---------------------------------------------
>>>>>>>
>>>>>>> DEBUG - HttpComponent                  - Receiving HTTP request: GET
>>>>>>> /LoginServiceService/main.wsdl HTTP/1.1
>>>>>>> Accept: */*
>>>>>>> User-Agent: XML Spy
>>>>>>> Host: bjc-d-xp:8199
>>>>>>> Connection: Keep-Alive
>>>>>>> Cache-Control: no-cache
>>>>>>>
>>>>>>>
>>>>>>> DEBUG - JettyContextManager            - Dispatching job:
>>>>>>> SCEP@10234051[d=true,io=0,w=true,b=false|false]
>>>>>>> DEBUG - JettyContextManager            - Dispatching job:
>>>>>>> SCEP@10234051[d=true,io=1,w=true,b=false|false]
>>>>>>> DEBUG - JettyContextManager            - Dispatching job:
>>>>>>> SCEP@10234051[d=true,io=1,w=true,b=false|false]
>>>>>>> DEBUG - HttpComponent                  - Receiving HTTP request: GET
>>>>>>> /LoginServiceService/ HTTP/1.1
>>>>>>> User-Agent: XML Spy
>>>>>>> SOAPAction: "urn:Login"
>>>>>>> Host: localhost:8199
>>>>>>> Connection: Keep-Alive
>>>>>>> Cache-Control: no-cache
>>>>>>>
>>>>>>>
>>>>>>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
>>>>>>> interceptor
>>>>>>> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor
>>>>>>> INFO  - PhaseInterceptorChain          - Interceptor has thrown
>>>>>>> exception,
>>>>>>> unwinding now
>>>>>>> java.lang.NullPointerException: InputStream content not found
>>>>>>> 	at
>>>>>>> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor.handleMessage(AttachmentsInInterceptor.java:46)
>>>>>>> 	at
>>>>>>> org.apache.servicemix.soap.core.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:85)
>>>>>>> 	at
>>>>>>> org.apache.servicemix.http.endpoints.HttpSoapConsumerMarshaler.createExchange(HttpSoapConsumerMarshaler.java:107)
>>>>>>> 	at
>>>>>>> org.apache.servicemix.http.endpoints.HttpConsumerEndpoint.createExchange(HttpConsumerEndpoint.java:488)
>>>>>>> 	at
>>>>>>> org.apache.servicemix.http.endpoints.HttpConsumerEndpoint.process(HttpConsumerEndpoint.java:293)
>>>>>>> 	at
>>>>>>> org.apache.servicemix.http.HttpBridgeServlet.service(HttpBridgeServlet.java:56)
>>>>>>> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
>>>>>>> 	at
>>>>>>> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
>>>>>>> 	at
>>>>>>> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:363)
>>>>>>> 	at
>>>>>>> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
>>>>>>> 	at
>>>>>>> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
>>>>>>> 	at
>>>>>>> org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
>>>>>>> 	at
>>>>>>> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
>>>>>>> 	at org.mortbay.jetty.Server.handle(Server.java:324)
>>>>>>> 	at
>>>>>>> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534)
>>>>>>> 	at
>>>>>>> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:864)
>>>>>>> 	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:533)
>>>>>>> 	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:207)
>>>>>>> 	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:403)
>>>>>>> 	at
>>>>>>> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
>>>>>>> 	at
>>>>>>> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:522)
>>>>>>> DEBUG - PhaseInterceptorChain          - Invoking handleFault on
>>>>>>> interceptor
>>>>>>> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor
>>>>>>> DEBUG - HttpSoapConsumerMarshaler      - Using default response
>>>>>>> content
>>>>>>> encoding.
>>>>>>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
>>>>>>> interceptor
>>>>>>> org.apache.servicemix.soap.interceptors.xml.StaxOutInterceptor
>>>>>>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
>>>>>>> interceptor
>>>>>>> org.apache.servicemix.soap.bindings.soap.interceptors.SoapOutInterceptor
>>>>>>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
>>>>>>> interceptor
>>>>>>> org.apache.servicemix.soap.bindings.soap.interceptors.SoapFaultOutInterceptor
>>>>>>>
>>>>>>>
>>>>>>> Jean-Baptiste Onofré wrote:
>>>>>>>> Hi Long,
>>>>>>>>
>>>>>>>> In your CXF-SE xbean.xml, I see that you try to make the JNDI lookup
>>>>>>>> on 
>>>>>>>> a Weblogic application server.
>>>>>>>>
>>>>>>>> Nevertheless, I can't see the weblogic.jar file into your SU lib
>>>>>>>> directory.
>>>>>>>>
>>>>>>>> To be able to make JNDI lookup and RMI-IIOP, you need the weblogic 
>>>>>>>> client lib.
>>>>>>>>
>>>>>>>> In your pom.xml, you should have a dependency like this:
>>>>>>>>
>>>>>>>> <dependency>
>>>>>>>>    <groupId>com.oracle.weblogic</groupId>
>>>>>>>>    <artifactId>server</artifactId>
>>>>>>>>    <version>10.3</version>
>>>>>>>> </dependency>
>>>>>>>>
>>>>>>>> You can install the weblogic.jar into your maven working copy using:
>>>>>>>> mvn install:install-file -DgroupId=com.oracle.weblogic 
>>>>>>>> -DartifactId=server -Dfile=$WLS_HOME/server/lib/weblogic.jar 
>>>>>>>> -Dversion=10.3 -Dpackaging=jar
>>>>>>>>
>>>>>>>> Could you make a try adding the weblogic.jar into the SU ?
>>>>>>>>
>>>>>>>> Regards
>>>>>>>> JB
>>>>>>>>
>>>>>>>> laolong wrote:
>>>>>>>>>  Hi JB,
>>>>>>>>>     
>>>>>>>>>      http://www.nabble.com/file/p23978791/demo.zip demo.zip 
>>>>>>>>>
>>>>>>>>>     I built a test EJB but got same error again, all java code and
>>>>>>>>> bean
>>>>>>>>> defination are in attached, could you please review it?
>>>>>>>>>     
>>>>>>>>>     I'm sorry that cannot find a way to send email with attachement
>>>>>>>>> to
>>>>>>>>> you
>>>>>>>>> alone, so I have to use 'Reply' page to upload the file.
>>>>>>>>>
>>>>>>>>>    Thanks a lot.
>>>>>>>>>
>>>>>>>>> Long  
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Hummm, weird.
>>>>>>>>>
>>>>>>>>> Could you provide the annotate in the your LoginService class (and
>>>>>>>>> the 
>>>>>>>>> corresponding interface) ?
>>>>>>>>> It looks like that the CXF-SE side is not deployed correctly (and
>>>>>>>>> so
>>>>>>>>> the 
>>>>>>>>> HTTP component can't find it).
>>>>>>>>> Have you all EJB proxy requirements present in your SU zip (EJBs
>>>>>>>>> stub, 
>>>>>>>>> etc) ?
>>>>>>>>> Is it possible to provide your cxf-se zip file (only to my, not on
>>>>>>>>> the 
>>>>>>>>> mailing list) ?
>>>>>>>>>
>>>>>>>>> Regards
>>>>>>>>> JB
>>
> 

Re: How to invoke EJB and How to disable WSDL validation in http:soap-consumer/provider?

Posted by laolong <le...@sina.com>.

Hi JB,

   GET is OK, but most of SOAP messges should be sent using POST, how can I
make POST method working within http component? or I have to use Tomcat
instead of Jetty?

Thanks,
Long


Jean-Baptiste Onofré wrote:
> 
> Yes,
> 
> I think that if you make a HTTP request using GET method, it should work.
> 
> Regards
> JB
> 
> laolong wrote:
>> 
>> Hi JB,
>> 
>>    Now I believe the problem is caused by HTTP component/Jetty issue, the
>> HTTP component cannot get POST data from HTTP request.  
>>    1. I create a SOAP marshaler and overwrite function createExchange
>> using
>> the source code from
>> org.apache.servicemix.http.endpoints.HttpSoapConsumerMarshaler.java like
>> below and remove REQUESt method checking (in red), then I can get correct
>> SOAP response from XMLSpy.
>> 
>> public MessageExchange createExchange(HttpServletRequest request,
>> 			ComponentContext context) throws Exception {
>> 		String method = request.getMethod();
>> 		System.out.println(method);
>> 		Message msg = super.getBinding().createMessage();
>> 		msg.put(ComponentContext.class, context);
>> 		msg.put(JbiConstants.USE_JBI_WRAPPER, super.isUseJbiWrapper());
>> 		msg.put(Message.CONTENT_TYPE, request.getContentType());
>> 		Map<String, String> headers = msg.getTransportHeaders();
>> 		for (Enumeration<?> e = request.getHeaderNames(); e.hasMoreElements();)
>> {
>> 			String name = (String) e.nextElement();
>> 			String value = request.getHeader(name);
>> 			headers.put(name, value);
>> 		}
>> 		headers.put(HttpConstants.REQUEST_URI, request.getRequestURL()
>> 				.toString());
>> 		headers.put(HttpConstants.CONTENT_TYPE, request.getContentType());
>> 		headers.put(HttpConstants.REQUEST_METHOD, method);
>> //		if (HttpConstants.METHOD_POST.equals(method)
>> //				|| HttpConstants.METHOD_PUT.equals(method)) {
>> 			msg.setContent(InputStream.class, request.getInputStream());
>> //		}
>> 		request.setAttribute(Message.class.getName(), msg);
>> 		InterceptorChain phase = getChain(Phase.ServerIn);
>> 		phase.doIntercept(msg);
>> 		return msg.getContent(MessageExchange.class);
>> 
>> 	}
>>    2. I also tried to use <http:endpoint>, it also get following error
>> message
>> 
>>    <pre>org.apache.cxf.interceptor.Fault: no jbi message element
>> 	at
>> org.apache.cxf.binding.jbi.interceptor.JBIWrapperInInterceptor.handleMessage(JBIWrapperInInterceptor.java:102)
>> 	at
>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
>> 	at
>> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:89)
>> 	at
>> org.apache.cxf.transport.jbi.JBIDispatcherUtil.dispatch(JBIDispatcherUtil.java:156)
>> 	at
>> org.apache.servicemix.cxfse.CxfSeEndpoint.process(CxfSeEndpoint.java:364)
>> 	at
>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:627)
>> 	at
>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:581)
>> 	at
>> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:535)
>> 	at
>> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>> 	at
>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:623)
>> 	at
>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>> 	at
>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>> 	at
>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>> 	at
>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
>> 	at
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
>> 	at java.lang.Thread.run(Thread.java:595)
>> </pre>
>> 
>> 
>> Thanks.
>> Long
>> 
>> 
>> 
>> Jean-Baptiste Onofré wrote:
>>> OK,
>>>
>>> The NullPointerException is raised into the Soap marshaler.
>>>
>>> Could you make a quick test using the "old" HTTP endpoint like this:
>>>     <http:endpoint service="service"
>>>                    endpoint="http"
>>>                    role="consumer"
>>>                    targetService="service"
>>>                    targetEndpoint="ejb"
>>>                    locationURI="http://0.0.0.0:8181/what/you/want"
>>>                    defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
>>>                    soap="true"
>>>                    />
>>>
>>> During this time, I take a look on the interceptor usage in the default 
>>> SOAP marshaler.
>>>
>>> Regards
>>> JB
>>>
>>> laolong wrote:
>>>> Hi JB,
>>>>    Yes, I think CXF-SU internal endpoint should be working.
>>>>    I tried servicemix-http-2009.01.0.1-fuse-installer.zip (FUSE
>>>> 3.4.0.2)
>>>> and
>>>> servicemix-http-2008.01-installer.zip(Servicemix3.3) , got same
>>>> 'InputStream
>>>> content not found' error.
>>>>
>>>> Thanks,
>>>> Long
>>>>
>>>>
>>>>
>>>> Jean-Baptiste Onofré wrote:
>>>>> If you can get the WSDL generated by CXF, the CXF-SU should be OK.
>>>>>
>>>>> I'm going to check in the HTTP component source code where is raised
>>>>> the 
>>>>>   NullPointerException.
>>>>> What's the version of the HTTP component that you use ?
>>>>>
>>>>> Regards
>>>>> JB
>>>>>
>>>>> laolong wrote:
>>>>>>  I guess the problem also caused by Http/Jetty issue, the request
>>>>>> message
>>>>>> cannot be processed, message content is lost due to the SOAP message
>>>>>> POST
>>>>>> by
>>>>>> XMLSpy is received with wrong method 'GET'
>>>>>>
>>>>>> SMX log---------------------------------------------
>>>>>>
>>>>>> DEBUG - HttpComponent                  - Receiving HTTP request: GET
>>>>>> /LoginServiceService/main.wsdl HTTP/1.1
>>>>>> Accept: */*
>>>>>> User-Agent: XML Spy
>>>>>> Host: bjc-d-xp:8199
>>>>>> Connection: Keep-Alive
>>>>>> Cache-Control: no-cache
>>>>>>
>>>>>>
>>>>>> DEBUG - JettyContextManager            - Dispatching job:
>>>>>> SCEP@10234051[d=true,io=0,w=true,b=false|false]
>>>>>> DEBUG - JettyContextManager            - Dispatching job:
>>>>>> SCEP@10234051[d=true,io=1,w=true,b=false|false]
>>>>>> DEBUG - JettyContextManager            - Dispatching job:
>>>>>> SCEP@10234051[d=true,io=1,w=true,b=false|false]
>>>>>> DEBUG - HttpComponent                  - Receiving HTTP request: GET
>>>>>> /LoginServiceService/ HTTP/1.1
>>>>>> User-Agent: XML Spy
>>>>>> SOAPAction: "urn:Login"
>>>>>> Host: localhost:8199
>>>>>> Connection: Keep-Alive
>>>>>> Cache-Control: no-cache
>>>>>>
>>>>>>
>>>>>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
>>>>>> interceptor
>>>>>> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor
>>>>>> INFO  - PhaseInterceptorChain          - Interceptor has thrown
>>>>>> exception,
>>>>>> unwinding now
>>>>>> java.lang.NullPointerException: InputStream content not found
>>>>>> 	at
>>>>>> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor.handleMessage(AttachmentsInInterceptor.java:46)
>>>>>> 	at
>>>>>> org.apache.servicemix.soap.core.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:85)
>>>>>> 	at
>>>>>> org.apache.servicemix.http.endpoints.HttpSoapConsumerMarshaler.createExchange(HttpSoapConsumerMarshaler.java:107)
>>>>>> 	at
>>>>>> org.apache.servicemix.http.endpoints.HttpConsumerEndpoint.createExchange(HttpConsumerEndpoint.java:488)
>>>>>> 	at
>>>>>> org.apache.servicemix.http.endpoints.HttpConsumerEndpoint.process(HttpConsumerEndpoint.java:293)
>>>>>> 	at
>>>>>> org.apache.servicemix.http.HttpBridgeServlet.service(HttpBridgeServlet.java:56)
>>>>>> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
>>>>>> 	at
>>>>>> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
>>>>>> 	at
>>>>>> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:363)
>>>>>> 	at
>>>>>> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
>>>>>> 	at
>>>>>> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
>>>>>> 	at
>>>>>> org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
>>>>>> 	at
>>>>>> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
>>>>>> 	at org.mortbay.jetty.Server.handle(Server.java:324)
>>>>>> 	at
>>>>>> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534)
>>>>>> 	at
>>>>>> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:864)
>>>>>> 	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:533)
>>>>>> 	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:207)
>>>>>> 	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:403)
>>>>>> 	at
>>>>>> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
>>>>>> 	at
>>>>>> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:522)
>>>>>> DEBUG - PhaseInterceptorChain          - Invoking handleFault on
>>>>>> interceptor
>>>>>> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor
>>>>>> DEBUG - HttpSoapConsumerMarshaler      - Using default response
>>>>>> content
>>>>>> encoding.
>>>>>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
>>>>>> interceptor
>>>>>> org.apache.servicemix.soap.interceptors.xml.StaxOutInterceptor
>>>>>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
>>>>>> interceptor
>>>>>> org.apache.servicemix.soap.bindings.soap.interceptors.SoapOutInterceptor
>>>>>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
>>>>>> interceptor
>>>>>> org.apache.servicemix.soap.bindings.soap.interceptors.SoapFaultOutInterceptor
>>>>>>
>>>>>>
>>>>>> Jean-Baptiste Onofré wrote:
>>>>>>> Hi Long,
>>>>>>>
>>>>>>> In your CXF-SE xbean.xml, I see that you try to make the JNDI lookup
>>>>>>> on 
>>>>>>> a Weblogic application server.
>>>>>>>
>>>>>>> Nevertheless, I can't see the weblogic.jar file into your SU lib
>>>>>>> directory.
>>>>>>>
>>>>>>> To be able to make JNDI lookup and RMI-IIOP, you need the weblogic 
>>>>>>> client lib.
>>>>>>>
>>>>>>> In your pom.xml, you should have a dependency like this:
>>>>>>>
>>>>>>> <dependency>
>>>>>>>    <groupId>com.oracle.weblogic</groupId>
>>>>>>>    <artifactId>server</artifactId>
>>>>>>>    <version>10.3</version>
>>>>>>> </dependency>
>>>>>>>
>>>>>>> You can install the weblogic.jar into your maven working copy using:
>>>>>>> mvn install:install-file -DgroupId=com.oracle.weblogic 
>>>>>>> -DartifactId=server -Dfile=$WLS_HOME/server/lib/weblogic.jar 
>>>>>>> -Dversion=10.3 -Dpackaging=jar
>>>>>>>
>>>>>>> Could you make a try adding the weblogic.jar into the SU ?
>>>>>>>
>>>>>>> Regards
>>>>>>> JB
>>>>>>>
>>>>>>> laolong wrote:
>>>>>>>>  Hi JB,
>>>>>>>>     
>>>>>>>>      http://www.nabble.com/file/p23978791/demo.zip demo.zip 
>>>>>>>>
>>>>>>>>     I built a test EJB but got same error again, all java code and
>>>>>>>> bean
>>>>>>>> defination are in attached, could you please review it?
>>>>>>>>     
>>>>>>>>     I'm sorry that cannot find a way to send email with attachement
>>>>>>>> to
>>>>>>>> you
>>>>>>>> alone, so I have to use 'Reply' page to upload the file.
>>>>>>>>
>>>>>>>>    Thanks a lot.
>>>>>>>>
>>>>>>>> Long  
>>>>>>>>
>>>>>>>>
>>>>>>>> Hummm, weird.
>>>>>>>>
>>>>>>>> Could you provide the annotate in the your LoginService class (and
>>>>>>>> the 
>>>>>>>> corresponding interface) ?
>>>>>>>> It looks like that the CXF-SE side is not deployed correctly (and
>>>>>>>> so
>>>>>>>> the 
>>>>>>>> HTTP component can't find it).
>>>>>>>> Have you all EJB proxy requirements present in your SU zip (EJBs
>>>>>>>> stub, 
>>>>>>>> etc) ?
>>>>>>>> Is it possible to provide your cxf-se zip file (only to my, not on
>>>>>>>> the 
>>>>>>>> mailing list) ?
>>>>>>>>
>>>>>>>> Regards
>>>>>>>> JB
>>>
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-invoke-EJB-and-How-to-disable-WSDL-validation-in-http%3Asoap-consumer-provider--tp23963883p23994105.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: How to invoke EJB and How to disable WSDL validation in http:soap-consumer/provider?

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Yes,

I think that if you make a HTTP request using GET method, it should work.

Regards
JB

laolong wrote:
> 
> Hi JB,
> 
>    Now I believe the problem is caused by HTTP component/Jetty issue, the
> HTTP component cannot get POST data from HTTP request.  
>    1. I create a SOAP marshaler and overwrite function createExchange using
> the source code from
> org.apache.servicemix.http.endpoints.HttpSoapConsumerMarshaler.java like
> below and remove REQUESt method checking (in red), then I can get correct
> SOAP response from XMLSpy.
> 
> public MessageExchange createExchange(HttpServletRequest request,
> 			ComponentContext context) throws Exception {
> 		String method = request.getMethod();
> 		System.out.println(method);
> 		Message msg = super.getBinding().createMessage();
> 		msg.put(ComponentContext.class, context);
> 		msg.put(JbiConstants.USE_JBI_WRAPPER, super.isUseJbiWrapper());
> 		msg.put(Message.CONTENT_TYPE, request.getContentType());
> 		Map<String, String> headers = msg.getTransportHeaders();
> 		for (Enumeration<?> e = request.getHeaderNames(); e.hasMoreElements();) {
> 			String name = (String) e.nextElement();
> 			String value = request.getHeader(name);
> 			headers.put(name, value);
> 		}
> 		headers.put(HttpConstants.REQUEST_URI, request.getRequestURL()
> 				.toString());
> 		headers.put(HttpConstants.CONTENT_TYPE, request.getContentType());
> 		headers.put(HttpConstants.REQUEST_METHOD, method);
> //		if (HttpConstants.METHOD_POST.equals(method)
> //				|| HttpConstants.METHOD_PUT.equals(method)) {
> 			msg.setContent(InputStream.class, request.getInputStream());
> //		}
> 		request.setAttribute(Message.class.getName(), msg);
> 		InterceptorChain phase = getChain(Phase.ServerIn);
> 		phase.doIntercept(msg);
> 		return msg.getContent(MessageExchange.class);
> 
> 	}
>    2. I also tried to use <http:endpoint>, it also get following error
> message
> 
>    <pre>org.apache.cxf.interceptor.Fault: no jbi message element
> 	at
> org.apache.cxf.binding.jbi.interceptor.JBIWrapperInInterceptor.handleMessage(JBIWrapperInInterceptor.java:102)
> 	at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
> 	at
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:89)
> 	at
> org.apache.cxf.transport.jbi.JBIDispatcherUtil.dispatch(JBIDispatcherUtil.java:156)
> 	at
> org.apache.servicemix.cxfse.CxfSeEndpoint.process(CxfSeEndpoint.java:364)
> 	at
> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:627)
> 	at
> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:581)
> 	at
> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:535)
> 	at
> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
> 	at
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:623)
> 	at
> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
> 	at
> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
> 	at
> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
> 	at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
> 	at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
> 	at java.lang.Thread.run(Thread.java:595)
> </pre>
> 
> 
> Thanks.
> Long
> 
> 
> 
> Jean-Baptiste Onofré wrote:
>> OK,
>>
>> The NullPointerException is raised into the Soap marshaler.
>>
>> Could you make a quick test using the "old" HTTP endpoint like this:
>>     <http:endpoint service="service"
>>                    endpoint="http"
>>                    role="consumer"
>>                    targetService="service"
>>                    targetEndpoint="ejb"
>>                    locationURI="http://0.0.0.0:8181/what/you/want"
>>                    defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
>>                    soap="true"
>>                    />
>>
>> During this time, I take a look on the interceptor usage in the default 
>> SOAP marshaler.
>>
>> Regards
>> JB
>>
>> laolong wrote:
>>> Hi JB,
>>>    Yes, I think CXF-SU internal endpoint should be working.
>>>    I tried servicemix-http-2009.01.0.1-fuse-installer.zip (FUSE 3.4.0.2)
>>> and
>>> servicemix-http-2008.01-installer.zip(Servicemix3.3) , got same
>>> 'InputStream
>>> content not found' error.
>>>
>>> Thanks,
>>> Long
>>>
>>>
>>>
>>> Jean-Baptiste Onofré wrote:
>>>> If you can get the WSDL generated by CXF, the CXF-SU should be OK.
>>>>
>>>> I'm going to check in the HTTP component source code where is raised the 
>>>>   NullPointerException.
>>>> What's the version of the HTTP component that you use ?
>>>>
>>>> Regards
>>>> JB
>>>>
>>>> laolong wrote:
>>>>>  I guess the problem also caused by Http/Jetty issue, the request
>>>>> message
>>>>> cannot be processed, message content is lost due to the SOAP message
>>>>> POST
>>>>> by
>>>>> XMLSpy is received with wrong method 'GET'
>>>>>
>>>>> SMX log---------------------------------------------
>>>>>
>>>>> DEBUG - HttpComponent                  - Receiving HTTP request: GET
>>>>> /LoginServiceService/main.wsdl HTTP/1.1
>>>>> Accept: */*
>>>>> User-Agent: XML Spy
>>>>> Host: bjc-d-xp:8199
>>>>> Connection: Keep-Alive
>>>>> Cache-Control: no-cache
>>>>>
>>>>>
>>>>> DEBUG - JettyContextManager            - Dispatching job:
>>>>> SCEP@10234051[d=true,io=0,w=true,b=false|false]
>>>>> DEBUG - JettyContextManager            - Dispatching job:
>>>>> SCEP@10234051[d=true,io=1,w=true,b=false|false]
>>>>> DEBUG - JettyContextManager            - Dispatching job:
>>>>> SCEP@10234051[d=true,io=1,w=true,b=false|false]
>>>>> DEBUG - HttpComponent                  - Receiving HTTP request: GET
>>>>> /LoginServiceService/ HTTP/1.1
>>>>> User-Agent: XML Spy
>>>>> SOAPAction: "urn:Login"
>>>>> Host: localhost:8199
>>>>> Connection: Keep-Alive
>>>>> Cache-Control: no-cache
>>>>>
>>>>>
>>>>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
>>>>> interceptor
>>>>> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor
>>>>> INFO  - PhaseInterceptorChain          - Interceptor has thrown
>>>>> exception,
>>>>> unwinding now
>>>>> java.lang.NullPointerException: InputStream content not found
>>>>> 	at
>>>>> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor.handleMessage(AttachmentsInInterceptor.java:46)
>>>>> 	at
>>>>> org.apache.servicemix.soap.core.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:85)
>>>>> 	at
>>>>> org.apache.servicemix.http.endpoints.HttpSoapConsumerMarshaler.createExchange(HttpSoapConsumerMarshaler.java:107)
>>>>> 	at
>>>>> org.apache.servicemix.http.endpoints.HttpConsumerEndpoint.createExchange(HttpConsumerEndpoint.java:488)
>>>>> 	at
>>>>> org.apache.servicemix.http.endpoints.HttpConsumerEndpoint.process(HttpConsumerEndpoint.java:293)
>>>>> 	at
>>>>> org.apache.servicemix.http.HttpBridgeServlet.service(HttpBridgeServlet.java:56)
>>>>> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
>>>>> 	at
>>>>> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
>>>>> 	at
>>>>> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:363)
>>>>> 	at
>>>>> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
>>>>> 	at
>>>>> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
>>>>> 	at
>>>>> org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
>>>>> 	at
>>>>> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
>>>>> 	at org.mortbay.jetty.Server.handle(Server.java:324)
>>>>> 	at
>>>>> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534)
>>>>> 	at
>>>>> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:864)
>>>>> 	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:533)
>>>>> 	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:207)
>>>>> 	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:403)
>>>>> 	at
>>>>> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
>>>>> 	at
>>>>> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:522)
>>>>> DEBUG - PhaseInterceptorChain          - Invoking handleFault on
>>>>> interceptor
>>>>> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor
>>>>> DEBUG - HttpSoapConsumerMarshaler      - Using default response content
>>>>> encoding.
>>>>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
>>>>> interceptor
>>>>> org.apache.servicemix.soap.interceptors.xml.StaxOutInterceptor
>>>>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
>>>>> interceptor
>>>>> org.apache.servicemix.soap.bindings.soap.interceptors.SoapOutInterceptor
>>>>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
>>>>> interceptor
>>>>> org.apache.servicemix.soap.bindings.soap.interceptors.SoapFaultOutInterceptor
>>>>>
>>>>>
>>>>> Jean-Baptiste Onofré wrote:
>>>>>> Hi Long,
>>>>>>
>>>>>> In your CXF-SE xbean.xml, I see that you try to make the JNDI lookup
>>>>>> on 
>>>>>> a Weblogic application server.
>>>>>>
>>>>>> Nevertheless, I can't see the weblogic.jar file into your SU lib
>>>>>> directory.
>>>>>>
>>>>>> To be able to make JNDI lookup and RMI-IIOP, you need the weblogic 
>>>>>> client lib.
>>>>>>
>>>>>> In your pom.xml, you should have a dependency like this:
>>>>>>
>>>>>> <dependency>
>>>>>>    <groupId>com.oracle.weblogic</groupId>
>>>>>>    <artifactId>server</artifactId>
>>>>>>    <version>10.3</version>
>>>>>> </dependency>
>>>>>>
>>>>>> You can install the weblogic.jar into your maven working copy using:
>>>>>> mvn install:install-file -DgroupId=com.oracle.weblogic 
>>>>>> -DartifactId=server -Dfile=$WLS_HOME/server/lib/weblogic.jar 
>>>>>> -Dversion=10.3 -Dpackaging=jar
>>>>>>
>>>>>> Could you make a try adding the weblogic.jar into the SU ?
>>>>>>
>>>>>> Regards
>>>>>> JB
>>>>>>
>>>>>> laolong wrote:
>>>>>>>  Hi JB,
>>>>>>>     
>>>>>>>      http://www.nabble.com/file/p23978791/demo.zip demo.zip 
>>>>>>>
>>>>>>>     I built a test EJB but got same error again, all java code and
>>>>>>> bean
>>>>>>> defination are in attached, could you please review it?
>>>>>>>     
>>>>>>>     I'm sorry that cannot find a way to send email with attachement
>>>>>>> to
>>>>>>> you
>>>>>>> alone, so I have to use 'Reply' page to upload the file.
>>>>>>>
>>>>>>>    Thanks a lot.
>>>>>>>
>>>>>>> Long  
>>>>>>>
>>>>>>>
>>>>>>> Hummm, weird.
>>>>>>>
>>>>>>> Could you provide the annotate in the your LoginService class (and
>>>>>>> the 
>>>>>>> corresponding interface) ?
>>>>>>> It looks like that the CXF-SE side is not deployed correctly (and so
>>>>>>> the 
>>>>>>> HTTP component can't find it).
>>>>>>> Have you all EJB proxy requirements present in your SU zip (EJBs
>>>>>>> stub, 
>>>>>>> etc) ?
>>>>>>> Is it possible to provide your cxf-se zip file (only to my, not on
>>>>>>> the 
>>>>>>> mailing list) ?
>>>>>>>
>>>>>>> Regards
>>>>>>> JB
>>
> 

Re: How to invoke EJB and How to disable WSDL validation in http:soap-consumer/provider?

Posted by laolong <le...@sina.com>.

Hi JB,

   Now I believe the problem is caused by HTTP component/Jetty issue, the
HTTP component cannot get POST data from HTTP request.  
   1. I create a SOAP marshaler and overwrite function createExchange using
the source code from
org.apache.servicemix.http.endpoints.HttpSoapConsumerMarshaler.java like
below and remove REQUESt method checking (in red), then I can get correct
SOAP response from XMLSpy.

public MessageExchange createExchange(HttpServletRequest request,
			ComponentContext context) throws Exception {
		String method = request.getMethod();
		System.out.println(method);
		Message msg = super.getBinding().createMessage();
		msg.put(ComponentContext.class, context);
		msg.put(JbiConstants.USE_JBI_WRAPPER, super.isUseJbiWrapper());
		msg.put(Message.CONTENT_TYPE, request.getContentType());
		Map<String, String> headers = msg.getTransportHeaders();
		for (Enumeration<?> e = request.getHeaderNames(); e.hasMoreElements();) {
			String name = (String) e.nextElement();
			String value = request.getHeader(name);
			headers.put(name, value);
		}
		headers.put(HttpConstants.REQUEST_URI, request.getRequestURL()
				.toString());
		headers.put(HttpConstants.CONTENT_TYPE, request.getContentType());
		headers.put(HttpConstants.REQUEST_METHOD, method);
//		if (HttpConstants.METHOD_POST.equals(method)
//				|| HttpConstants.METHOD_PUT.equals(method)) {
			msg.setContent(InputStream.class, request.getInputStream());
//		}
		request.setAttribute(Message.class.getName(), msg);
		InterceptorChain phase = getChain(Phase.ServerIn);
		phase.doIntercept(msg);
		return msg.getContent(MessageExchange.class);

	}
   2. I also tried to use <http:endpoint>, it also get following error
message

   <pre>org.apache.cxf.interceptor.Fault: no jbi message element
	at
org.apache.cxf.binding.jbi.interceptor.JBIWrapperInInterceptor.handleMessage(JBIWrapperInInterceptor.java:102)
	at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
	at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:89)
	at
org.apache.cxf.transport.jbi.JBIDispatcherUtil.dispatch(JBIDispatcherUtil.java:156)
	at
org.apache.servicemix.cxfse.CxfSeEndpoint.process(CxfSeEndpoint.java:364)
	at
org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:627)
	at
org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:581)
	at
org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:535)
	at
org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
	at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:623)
	at
org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
	at
org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
	at
org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
	at java.lang.Thread.run(Thread.java:595)
</pre>


Thanks.
Long



Jean-Baptiste Onofré wrote:
> 
> OK,
> 
> The NullPointerException is raised into the Soap marshaler.
> 
> Could you make a quick test using the "old" HTTP endpoint like this:
>     <http:endpoint service="service"
>                    endpoint="http"
>                    role="consumer"
>                    targetService="service"
>                    targetEndpoint="ejb"
>                    locationURI="http://0.0.0.0:8181/what/you/want"
>                    defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
>                    soap="true"
>                    />
> 
> During this time, I take a look on the interceptor usage in the default 
> SOAP marshaler.
> 
> Regards
> JB
> 
> laolong wrote:
>> Hi JB,
>>    Yes, I think CXF-SU internal endpoint should be working.
>>    I tried servicemix-http-2009.01.0.1-fuse-installer.zip (FUSE 3.4.0.2)
>> and
>> servicemix-http-2008.01-installer.zip(Servicemix3.3) , got same
>> 'InputStream
>> content not found' error.
>> 
>> Thanks,
>> Long
>> 
>> 
>> 
>> Jean-Baptiste Onofré wrote:
>>> If you can get the WSDL generated by CXF, the CXF-SU should be OK.
>>>
>>> I'm going to check in the HTTP component source code where is raised the 
>>>   NullPointerException.
>>> What's the version of the HTTP component that you use ?
>>>
>>> Regards
>>> JB
>>>
>>> laolong wrote:
>>>>  I guess the problem also caused by Http/Jetty issue, the request
>>>> message
>>>> cannot be processed, message content is lost due to the SOAP message
>>>> POST
>>>> by
>>>> XMLSpy is received with wrong method 'GET'
>>>>
>>>> SMX log---------------------------------------------
>>>>
>>>> DEBUG - HttpComponent                  - Receiving HTTP request: GET
>>>> /LoginServiceService/main.wsdl HTTP/1.1
>>>> Accept: */*
>>>> User-Agent: XML Spy
>>>> Host: bjc-d-xp:8199
>>>> Connection: Keep-Alive
>>>> Cache-Control: no-cache
>>>>
>>>>
>>>> DEBUG - JettyContextManager            - Dispatching job:
>>>> SCEP@10234051[d=true,io=0,w=true,b=false|false]
>>>> DEBUG - JettyContextManager            - Dispatching job:
>>>> SCEP@10234051[d=true,io=1,w=true,b=false|false]
>>>> DEBUG - JettyContextManager            - Dispatching job:
>>>> SCEP@10234051[d=true,io=1,w=true,b=false|false]
>>>> DEBUG - HttpComponent                  - Receiving HTTP request: GET
>>>> /LoginServiceService/ HTTP/1.1
>>>> User-Agent: XML Spy
>>>> SOAPAction: "urn:Login"
>>>> Host: localhost:8199
>>>> Connection: Keep-Alive
>>>> Cache-Control: no-cache
>>>>
>>>>
>>>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
>>>> interceptor
>>>> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor
>>>> INFO  - PhaseInterceptorChain          - Interceptor has thrown
>>>> exception,
>>>> unwinding now
>>>> java.lang.NullPointerException: InputStream content not found
>>>> 	at
>>>> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor.handleMessage(AttachmentsInInterceptor.java:46)
>>>> 	at
>>>> org.apache.servicemix.soap.core.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:85)
>>>> 	at
>>>> org.apache.servicemix.http.endpoints.HttpSoapConsumerMarshaler.createExchange(HttpSoapConsumerMarshaler.java:107)
>>>> 	at
>>>> org.apache.servicemix.http.endpoints.HttpConsumerEndpoint.createExchange(HttpConsumerEndpoint.java:488)
>>>> 	at
>>>> org.apache.servicemix.http.endpoints.HttpConsumerEndpoint.process(HttpConsumerEndpoint.java:293)
>>>> 	at
>>>> org.apache.servicemix.http.HttpBridgeServlet.service(HttpBridgeServlet.java:56)
>>>> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
>>>> 	at
>>>> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
>>>> 	at
>>>> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:363)
>>>> 	at
>>>> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
>>>> 	at
>>>> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
>>>> 	at
>>>> org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
>>>> 	at
>>>> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
>>>> 	at org.mortbay.jetty.Server.handle(Server.java:324)
>>>> 	at
>>>> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534)
>>>> 	at
>>>> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:864)
>>>> 	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:533)
>>>> 	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:207)
>>>> 	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:403)
>>>> 	at
>>>> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
>>>> 	at
>>>> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:522)
>>>> DEBUG - PhaseInterceptorChain          - Invoking handleFault on
>>>> interceptor
>>>> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor
>>>> DEBUG - HttpSoapConsumerMarshaler      - Using default response content
>>>> encoding.
>>>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
>>>> interceptor
>>>> org.apache.servicemix.soap.interceptors.xml.StaxOutInterceptor
>>>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
>>>> interceptor
>>>> org.apache.servicemix.soap.bindings.soap.interceptors.SoapOutInterceptor
>>>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
>>>> interceptor
>>>> org.apache.servicemix.soap.bindings.soap.interceptors.SoapFaultOutInterceptor
>>>>
>>>>
>>>> Jean-Baptiste Onofré wrote:
>>>>> Hi Long,
>>>>>
>>>>> In your CXF-SE xbean.xml, I see that you try to make the JNDI lookup
>>>>> on 
>>>>> a Weblogic application server.
>>>>>
>>>>> Nevertheless, I can't see the weblogic.jar file into your SU lib
>>>>> directory.
>>>>>
>>>>> To be able to make JNDI lookup and RMI-IIOP, you need the weblogic 
>>>>> client lib.
>>>>>
>>>>> In your pom.xml, you should have a dependency like this:
>>>>>
>>>>> <dependency>
>>>>>    <groupId>com.oracle.weblogic</groupId>
>>>>>    <artifactId>server</artifactId>
>>>>>    <version>10.3</version>
>>>>> </dependency>
>>>>>
>>>>> You can install the weblogic.jar into your maven working copy using:
>>>>> mvn install:install-file -DgroupId=com.oracle.weblogic 
>>>>> -DartifactId=server -Dfile=$WLS_HOME/server/lib/weblogic.jar 
>>>>> -Dversion=10.3 -Dpackaging=jar
>>>>>
>>>>> Could you make a try adding the weblogic.jar into the SU ?
>>>>>
>>>>> Regards
>>>>> JB
>>>>>
>>>>> laolong wrote:
>>>>>>  Hi JB,
>>>>>>     
>>>>>>      http://www.nabble.com/file/p23978791/demo.zip demo.zip 
>>>>>>
>>>>>>     I built a test EJB but got same error again, all java code and
>>>>>> bean
>>>>>> defination are in attached, could you please review it?
>>>>>>     
>>>>>>     I'm sorry that cannot find a way to send email with attachement
>>>>>> to
>>>>>> you
>>>>>> alone, so I have to use 'Reply' page to upload the file.
>>>>>>
>>>>>>    Thanks a lot.
>>>>>>
>>>>>> Long  
>>>>>>
>>>>>>
>>>>>> Hummm, weird.
>>>>>>
>>>>>> Could you provide the annotate in the your LoginService class (and
>>>>>> the 
>>>>>> corresponding interface) ?
>>>>>> It looks like that the CXF-SE side is not deployed correctly (and so
>>>>>> the 
>>>>>> HTTP component can't find it).
>>>>>> Have you all EJB proxy requirements present in your SU zip (EJBs
>>>>>> stub, 
>>>>>> etc) ?
>>>>>> Is it possible to provide your cxf-se zip file (only to my, not on
>>>>>> the 
>>>>>> mailing list) ?
>>>>>>
>>>>>> Regards
>>>>>> JB
>>>
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-invoke-EJB-and-How-to-disable-WSDL-validation-in-http%3Asoap-consumer-provider--tp23963883p23993875.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: How to invoke EJB and How to disable WSDL validation in http:soap-consumer/provider?

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
OK,

The NullPointerException is raised into the Soap marshaler.

Could you make a quick test using the "old" HTTP endpoint like this:
    <http:endpoint service="service"
                   endpoint="http"
                   role="consumer"
                   targetService="service"
                   targetEndpoint="ejb"
                   locationURI="http://0.0.0.0:8181/what/you/want"
                   defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
                   soap="true"
                   />

During this time, I take a look on the interceptor usage in the default 
SOAP marshaler.

Regards
JB

laolong wrote:
> Hi JB,
>    Yes, I think CXF-SU internal endpoint should be working.
>    I tried servicemix-http-2009.01.0.1-fuse-installer.zip (FUSE 3.4.0.2) and
> servicemix-http-2008.01-installer.zip(Servicemix3.3) , got same 'InputStream
> content not found' error.
> 
> Thanks,
> Long
> 
> 
> 
> Jean-Baptiste Onofré wrote:
>> If you can get the WSDL generated by CXF, the CXF-SU should be OK.
>>
>> I'm going to check in the HTTP component source code where is raised the 
>>   NullPointerException.
>> What's the version of the HTTP component that you use ?
>>
>> Regards
>> JB
>>
>> laolong wrote:
>>>  I guess the problem also caused by Http/Jetty issue, the request message
>>> cannot be processed, message content is lost due to the SOAP message POST
>>> by
>>> XMLSpy is received with wrong method 'GET'
>>>
>>> SMX log---------------------------------------------
>>>
>>> DEBUG - HttpComponent                  - Receiving HTTP request: GET
>>> /LoginServiceService/main.wsdl HTTP/1.1
>>> Accept: */*
>>> User-Agent: XML Spy
>>> Host: bjc-d-xp:8199
>>> Connection: Keep-Alive
>>> Cache-Control: no-cache
>>>
>>>
>>> DEBUG - JettyContextManager            - Dispatching job:
>>> SCEP@10234051[d=true,io=0,w=true,b=false|false]
>>> DEBUG - JettyContextManager            - Dispatching job:
>>> SCEP@10234051[d=true,io=1,w=true,b=false|false]
>>> DEBUG - JettyContextManager            - Dispatching job:
>>> SCEP@10234051[d=true,io=1,w=true,b=false|false]
>>> DEBUG - HttpComponent                  - Receiving HTTP request: GET
>>> /LoginServiceService/ HTTP/1.1
>>> User-Agent: XML Spy
>>> SOAPAction: "urn:Login"
>>> Host: localhost:8199
>>> Connection: Keep-Alive
>>> Cache-Control: no-cache
>>>
>>>
>>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
>>> interceptor
>>> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor
>>> INFO  - PhaseInterceptorChain          - Interceptor has thrown
>>> exception,
>>> unwinding now
>>> java.lang.NullPointerException: InputStream content not found
>>> 	at
>>> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor.handleMessage(AttachmentsInInterceptor.java:46)
>>> 	at
>>> org.apache.servicemix.soap.core.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:85)
>>> 	at
>>> org.apache.servicemix.http.endpoints.HttpSoapConsumerMarshaler.createExchange(HttpSoapConsumerMarshaler.java:107)
>>> 	at
>>> org.apache.servicemix.http.endpoints.HttpConsumerEndpoint.createExchange(HttpConsumerEndpoint.java:488)
>>> 	at
>>> org.apache.servicemix.http.endpoints.HttpConsumerEndpoint.process(HttpConsumerEndpoint.java:293)
>>> 	at
>>> org.apache.servicemix.http.HttpBridgeServlet.service(HttpBridgeServlet.java:56)
>>> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
>>> 	at
>>> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
>>> 	at
>>> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:363)
>>> 	at
>>> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
>>> 	at
>>> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
>>> 	at
>>> org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
>>> 	at
>>> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
>>> 	at org.mortbay.jetty.Server.handle(Server.java:324)
>>> 	at
>>> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534)
>>> 	at
>>> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:864)
>>> 	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:533)
>>> 	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:207)
>>> 	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:403)
>>> 	at
>>> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
>>> 	at
>>> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:522)
>>> DEBUG - PhaseInterceptorChain          - Invoking handleFault on
>>> interceptor
>>> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor
>>> DEBUG - HttpSoapConsumerMarshaler      - Using default response content
>>> encoding.
>>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
>>> interceptor
>>> org.apache.servicemix.soap.interceptors.xml.StaxOutInterceptor
>>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
>>> interceptor
>>> org.apache.servicemix.soap.bindings.soap.interceptors.SoapOutInterceptor
>>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
>>> interceptor
>>> org.apache.servicemix.soap.bindings.soap.interceptors.SoapFaultOutInterceptor
>>>
>>>
>>> Jean-Baptiste Onofré wrote:
>>>> Hi Long,
>>>>
>>>> In your CXF-SE xbean.xml, I see that you try to make the JNDI lookup on 
>>>> a Weblogic application server.
>>>>
>>>> Nevertheless, I can't see the weblogic.jar file into your SU lib
>>>> directory.
>>>>
>>>> To be able to make JNDI lookup and RMI-IIOP, you need the weblogic 
>>>> client lib.
>>>>
>>>> In your pom.xml, you should have a dependency like this:
>>>>
>>>> <dependency>
>>>>    <groupId>com.oracle.weblogic</groupId>
>>>>    <artifactId>server</artifactId>
>>>>    <version>10.3</version>
>>>> </dependency>
>>>>
>>>> You can install the weblogic.jar into your maven working copy using:
>>>> mvn install:install-file -DgroupId=com.oracle.weblogic 
>>>> -DartifactId=server -Dfile=$WLS_HOME/server/lib/weblogic.jar 
>>>> -Dversion=10.3 -Dpackaging=jar
>>>>
>>>> Could you make a try adding the weblogic.jar into the SU ?
>>>>
>>>> Regards
>>>> JB
>>>>
>>>> laolong wrote:
>>>>>  Hi JB,
>>>>>     
>>>>>      http://www.nabble.com/file/p23978791/demo.zip demo.zip 
>>>>>
>>>>>     I built a test EJB but got same error again, all java code and bean
>>>>> defination are in attached, could you please review it?
>>>>>     
>>>>>     I'm sorry that cannot find a way to send email with attachement to
>>>>> you
>>>>> alone, so I have to use 'Reply' page to upload the file.
>>>>>
>>>>>    Thanks a lot.
>>>>>
>>>>> Long  
>>>>>
>>>>>
>>>>> Hummm, weird.
>>>>>
>>>>> Could you provide the annotate in the your LoginService class (and the 
>>>>> corresponding interface) ?
>>>>> It looks like that the CXF-SE side is not deployed correctly (and so
>>>>> the 
>>>>> HTTP component can't find it).
>>>>> Have you all EJB proxy requirements present in your SU zip (EJBs stub, 
>>>>> etc) ?
>>>>> Is it possible to provide your cxf-se zip file (only to my, not on the 
>>>>> mailing list) ?
>>>>>
>>>>> Regards
>>>>> JB
>>
> 

Re: How to invoke EJB and How to disable WSDL validation in http:soap-consumer/provider?

Posted by laolong <le...@sina.com>.
Hi JB,
   Yes, I think CXF-SU internal endpoint should be working.
   I tried servicemix-http-2009.01.0.1-fuse-installer.zip (FUSE 3.4.0.2) and
servicemix-http-2008.01-installer.zip(Servicemix3.3) , got same 'InputStream
content not found' error.

Thanks,
Long



Jean-Baptiste Onofré wrote:
> 
> If you can get the WSDL generated by CXF, the CXF-SU should be OK.
> 
> I'm going to check in the HTTP component source code where is raised the 
>   NullPointerException.
> What's the version of the HTTP component that you use ?
> 
> Regards
> JB
> 
> laolong wrote:
>>  I guess the problem also caused by Http/Jetty issue, the request message
>> cannot be processed, message content is lost due to the SOAP message POST
>> by
>> XMLSpy is received with wrong method 'GET'
>> 
>> SMX log---------------------------------------------
>> 
>> DEBUG - HttpComponent                  - Receiving HTTP request: GET
>> /LoginServiceService/main.wsdl HTTP/1.1
>> Accept: */*
>> User-Agent: XML Spy
>> Host: bjc-d-xp:8199
>> Connection: Keep-Alive
>> Cache-Control: no-cache
>> 
>> 
>> DEBUG - JettyContextManager            - Dispatching job:
>> SCEP@10234051[d=true,io=0,w=true,b=false|false]
>> DEBUG - JettyContextManager            - Dispatching job:
>> SCEP@10234051[d=true,io=1,w=true,b=false|false]
>> DEBUG - JettyContextManager            - Dispatching job:
>> SCEP@10234051[d=true,io=1,w=true,b=false|false]
>> DEBUG - HttpComponent                  - Receiving HTTP request: GET
>> /LoginServiceService/ HTTP/1.1
>> User-Agent: XML Spy
>> SOAPAction: "urn:Login"
>> Host: localhost:8199
>> Connection: Keep-Alive
>> Cache-Control: no-cache
>> 
>> 
>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
>> interceptor
>> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor
>> INFO  - PhaseInterceptorChain          - Interceptor has thrown
>> exception,
>> unwinding now
>> java.lang.NullPointerException: InputStream content not found
>> 	at
>> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor.handleMessage(AttachmentsInInterceptor.java:46)
>> 	at
>> org.apache.servicemix.soap.core.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:85)
>> 	at
>> org.apache.servicemix.http.endpoints.HttpSoapConsumerMarshaler.createExchange(HttpSoapConsumerMarshaler.java:107)
>> 	at
>> org.apache.servicemix.http.endpoints.HttpConsumerEndpoint.createExchange(HttpConsumerEndpoint.java:488)
>> 	at
>> org.apache.servicemix.http.endpoints.HttpConsumerEndpoint.process(HttpConsumerEndpoint.java:293)
>> 	at
>> org.apache.servicemix.http.HttpBridgeServlet.service(HttpBridgeServlet.java:56)
>> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
>> 	at
>> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
>> 	at
>> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:363)
>> 	at
>> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
>> 	at
>> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
>> 	at
>> org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
>> 	at
>> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
>> 	at org.mortbay.jetty.Server.handle(Server.java:324)
>> 	at
>> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534)
>> 	at
>> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:864)
>> 	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:533)
>> 	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:207)
>> 	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:403)
>> 	at
>> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
>> 	at
>> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:522)
>> DEBUG - PhaseInterceptorChain          - Invoking handleFault on
>> interceptor
>> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor
>> DEBUG - HttpSoapConsumerMarshaler      - Using default response content
>> encoding.
>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
>> interceptor
>> org.apache.servicemix.soap.interceptors.xml.StaxOutInterceptor
>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
>> interceptor
>> org.apache.servicemix.soap.bindings.soap.interceptors.SoapOutInterceptor
>> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
>> interceptor
>> org.apache.servicemix.soap.bindings.soap.interceptors.SoapFaultOutInterceptor
>> 
>> 
>> Jean-Baptiste Onofré wrote:
>>> Hi Long,
>>>
>>> In your CXF-SE xbean.xml, I see that you try to make the JNDI lookup on 
>>> a Weblogic application server.
>>>
>>> Nevertheless, I can't see the weblogic.jar file into your SU lib
>>> directory.
>>>
>>> To be able to make JNDI lookup and RMI-IIOP, you need the weblogic 
>>> client lib.
>>>
>>> In your pom.xml, you should have a dependency like this:
>>>
>>> <dependency>
>>>    <groupId>com.oracle.weblogic</groupId>
>>>    <artifactId>server</artifactId>
>>>    <version>10.3</version>
>>> </dependency>
>>>
>>> You can install the weblogic.jar into your maven working copy using:
>>> mvn install:install-file -DgroupId=com.oracle.weblogic 
>>> -DartifactId=server -Dfile=$WLS_HOME/server/lib/weblogic.jar 
>>> -Dversion=10.3 -Dpackaging=jar
>>>
>>> Could you make a try adding the weblogic.jar into the SU ?
>>>
>>> Regards
>>> JB
>>>
>>> laolong wrote:
>>>>  Hi JB,
>>>>     
>>>>      http://www.nabble.com/file/p23978791/demo.zip demo.zip 
>>>>
>>>>     I built a test EJB but got same error again, all java code and bean
>>>> defination are in attached, could you please review it?
>>>>     
>>>>     I'm sorry that cannot find a way to send email with attachement to
>>>> you
>>>> alone, so I have to use 'Reply' page to upload the file.
>>>>
>>>>    Thanks a lot.
>>>>
>>>> Long  
>>>>
>>>>
>>>> Hummm, weird.
>>>>
>>>> Could you provide the annotate in the your LoginService class (and the 
>>>> corresponding interface) ?
>>>> It looks like that the CXF-SE side is not deployed correctly (and so
>>>> the 
>>>> HTTP component can't find it).
>>>> Have you all EJB proxy requirements present in your SU zip (EJBs stub, 
>>>> etc) ?
>>>> Is it possible to provide your cxf-se zip file (only to my, not on the 
>>>> mailing list) ?
>>>>
>>>> Regards
>>>> JB
>>>
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-invoke-EJB-and-How-to-disable-WSDL-validation-in-http%3Asoap-consumer-provider--tp23963883p23993323.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: How to invoke EJB and How to disable WSDL validation in http:soap-consumer/provider?

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
If you can get the WSDL generated by CXF, the CXF-SU should be OK.

I'm going to check in the HTTP component source code where is raised the 
  NullPointerException.
What's the version of the HTTP component that you use ?

Regards
JB

laolong wrote:
>  I guess the problem also caused by Http/Jetty issue, the request message
> cannot be processed, message content is lost due to the SOAP message POST by
> XMLSpy is received with wrong method 'GET'
> 
> SMX log---------------------------------------------
> 
> DEBUG - HttpComponent                  - Receiving HTTP request: GET
> /LoginServiceService/main.wsdl HTTP/1.1
> Accept: */*
> User-Agent: XML Spy
> Host: bjc-d-xp:8199
> Connection: Keep-Alive
> Cache-Control: no-cache
> 
> 
> DEBUG - JettyContextManager            - Dispatching job:
> SCEP@10234051[d=true,io=0,w=true,b=false|false]
> DEBUG - JettyContextManager            - Dispatching job:
> SCEP@10234051[d=true,io=1,w=true,b=false|false]
> DEBUG - JettyContextManager            - Dispatching job:
> SCEP@10234051[d=true,io=1,w=true,b=false|false]
> DEBUG - HttpComponent                  - Receiving HTTP request: GET
> /LoginServiceService/ HTTP/1.1
> User-Agent: XML Spy
> SOAPAction: "urn:Login"
> Host: localhost:8199
> Connection: Keep-Alive
> Cache-Control: no-cache
> 
> 
> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
> interceptor
> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor
> INFO  - PhaseInterceptorChain          - Interceptor has thrown exception,
> unwinding now
> java.lang.NullPointerException: InputStream content not found
> 	at
> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor.handleMessage(AttachmentsInInterceptor.java:46)
> 	at
> org.apache.servicemix.soap.core.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:85)
> 	at
> org.apache.servicemix.http.endpoints.HttpSoapConsumerMarshaler.createExchange(HttpSoapConsumerMarshaler.java:107)
> 	at
> org.apache.servicemix.http.endpoints.HttpConsumerEndpoint.createExchange(HttpConsumerEndpoint.java:488)
> 	at
> org.apache.servicemix.http.endpoints.HttpConsumerEndpoint.process(HttpConsumerEndpoint.java:293)
> 	at
> org.apache.servicemix.http.HttpBridgeServlet.service(HttpBridgeServlet.java:56)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
> 	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
> 	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:363)
> 	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
> 	at
> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
> 	at
> org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
> 	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
> 	at org.mortbay.jetty.Server.handle(Server.java:324)
> 	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534)
> 	at
> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:864)
> 	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:533)
> 	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:207)
> 	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:403)
> 	at
> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
> 	at
> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:522)
> DEBUG - PhaseInterceptorChain          - Invoking handleFault on interceptor
> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor
> DEBUG - HttpSoapConsumerMarshaler      - Using default response content
> encoding.
> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
> interceptor org.apache.servicemix.soap.interceptors.xml.StaxOutInterceptor
> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
> interceptor
> org.apache.servicemix.soap.bindings.soap.interceptors.SoapOutInterceptor
> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
> interceptor
> org.apache.servicemix.soap.bindings.soap.interceptors.SoapFaultOutInterceptor
> 
> 
> Jean-Baptiste Onofré wrote:
>> Hi Long,
>>
>> In your CXF-SE xbean.xml, I see that you try to make the JNDI lookup on 
>> a Weblogic application server.
>>
>> Nevertheless, I can't see the weblogic.jar file into your SU lib
>> directory.
>>
>> To be able to make JNDI lookup and RMI-IIOP, you need the weblogic 
>> client lib.
>>
>> In your pom.xml, you should have a dependency like this:
>>
>> <dependency>
>>    <groupId>com.oracle.weblogic</groupId>
>>    <artifactId>server</artifactId>
>>    <version>10.3</version>
>> </dependency>
>>
>> You can install the weblogic.jar into your maven working copy using:
>> mvn install:install-file -DgroupId=com.oracle.weblogic 
>> -DartifactId=server -Dfile=$WLS_HOME/server/lib/weblogic.jar 
>> -Dversion=10.3 -Dpackaging=jar
>>
>> Could you make a try adding the weblogic.jar into the SU ?
>>
>> Regards
>> JB
>>
>> laolong wrote:
>>>  Hi JB,
>>>     
>>>      http://www.nabble.com/file/p23978791/demo.zip demo.zip 
>>>
>>>     I built a test EJB but got same error again, all java code and bean
>>> defination are in attached, could you please review it?
>>>     
>>>     I'm sorry that cannot find a way to send email with attachement to
>>> you
>>> alone, so I have to use 'Reply' page to upload the file.
>>>
>>>    Thanks a lot.
>>>
>>> Long  
>>>
>>>
>>> Hummm, weird.
>>>
>>> Could you provide the annotate in the your LoginService class (and the 
>>> corresponding interface) ?
>>> It looks like that the CXF-SE side is not deployed correctly (and so the 
>>> HTTP component can't find it).
>>> Have you all EJB proxy requirements present in your SU zip (EJBs stub, 
>>> etc) ?
>>> Is it possible to provide your cxf-se zip file (only to my, not on the 
>>> mailing list) ?
>>>
>>> Regards
>>> JB
>>
> 

Re: How to invoke EJB and How to disable WSDL validation in http:soap-consumer/provider?

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
OK I got it. The code snip is:

     public void handleMessage(Message message) {
         InputStream is = message.getContent(InputStream.class);
         if (is == null) {
             throw new NullPointerException("InputStream content not 
found");
         }

I check why the message doesn't contain input stream.

Regards
JB

laolong wrote:
>  I guess the problem also caused by Http/Jetty issue, the request message
> cannot be processed, message content is lost due to the SOAP message POST by
> XMLSpy is received with wrong method 'GET'
> 
> SMX log---------------------------------------------
> 
> DEBUG - HttpComponent                  - Receiving HTTP request: GET
> /LoginServiceService/main.wsdl HTTP/1.1
> Accept: */*
> User-Agent: XML Spy
> Host: bjc-d-xp:8199
> Connection: Keep-Alive
> Cache-Control: no-cache
> 
> 
> DEBUG - JettyContextManager            - Dispatching job:
> SCEP@10234051[d=true,io=0,w=true,b=false|false]
> DEBUG - JettyContextManager            - Dispatching job:
> SCEP@10234051[d=true,io=1,w=true,b=false|false]
> DEBUG - JettyContextManager            - Dispatching job:
> SCEP@10234051[d=true,io=1,w=true,b=false|false]
> DEBUG - HttpComponent                  - Receiving HTTP request: GET
> /LoginServiceService/ HTTP/1.1
> User-Agent: XML Spy
> SOAPAction: "urn:Login"
> Host: localhost:8199
> Connection: Keep-Alive
> Cache-Control: no-cache
> 
> 
> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
> interceptor
> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor
> INFO  - PhaseInterceptorChain          - Interceptor has thrown exception,
> unwinding now
> java.lang.NullPointerException: InputStream content not found
> 	at
> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor.handleMessage(AttachmentsInInterceptor.java:46)
> 	at
> org.apache.servicemix.soap.core.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:85)
> 	at
> org.apache.servicemix.http.endpoints.HttpSoapConsumerMarshaler.createExchange(HttpSoapConsumerMarshaler.java:107)
> 	at
> org.apache.servicemix.http.endpoints.HttpConsumerEndpoint.createExchange(HttpConsumerEndpoint.java:488)
> 	at
> org.apache.servicemix.http.endpoints.HttpConsumerEndpoint.process(HttpConsumerEndpoint.java:293)
> 	at
> org.apache.servicemix.http.HttpBridgeServlet.service(HttpBridgeServlet.java:56)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
> 	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
> 	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:363)
> 	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
> 	at
> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
> 	at
> org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
> 	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
> 	at org.mortbay.jetty.Server.handle(Server.java:324)
> 	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534)
> 	at
> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:864)
> 	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:533)
> 	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:207)
> 	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:403)
> 	at
> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
> 	at
> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:522)
> DEBUG - PhaseInterceptorChain          - Invoking handleFault on interceptor
> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor
> DEBUG - HttpSoapConsumerMarshaler      - Using default response content
> encoding.
> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
> interceptor org.apache.servicemix.soap.interceptors.xml.StaxOutInterceptor
> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
> interceptor
> org.apache.servicemix.soap.bindings.soap.interceptors.SoapOutInterceptor
> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
> interceptor
> org.apache.servicemix.soap.bindings.soap.interceptors.SoapFaultOutInterceptor
> 
> 
> Jean-Baptiste Onofré wrote:
>> Hi Long,
>>
>> In your CXF-SE xbean.xml, I see that you try to make the JNDI lookup on 
>> a Weblogic application server.
>>
>> Nevertheless, I can't see the weblogic.jar file into your SU lib
>> directory.
>>
>> To be able to make JNDI lookup and RMI-IIOP, you need the weblogic 
>> client lib.
>>
>> In your pom.xml, you should have a dependency like this:
>>
>> <dependency>
>>    <groupId>com.oracle.weblogic</groupId>
>>    <artifactId>server</artifactId>
>>    <version>10.3</version>
>> </dependency>
>>
>> You can install the weblogic.jar into your maven working copy using:
>> mvn install:install-file -DgroupId=com.oracle.weblogic 
>> -DartifactId=server -Dfile=$WLS_HOME/server/lib/weblogic.jar 
>> -Dversion=10.3 -Dpackaging=jar
>>
>> Could you make a try adding the weblogic.jar into the SU ?
>>
>> Regards
>> JB
>>
>> laolong wrote:
>>>  Hi JB,
>>>     
>>>      http://www.nabble.com/file/p23978791/demo.zip demo.zip 
>>>
>>>     I built a test EJB but got same error again, all java code and bean
>>> defination are in attached, could you please review it?
>>>     
>>>     I'm sorry that cannot find a way to send email with attachement to
>>> you
>>> alone, so I have to use 'Reply' page to upload the file.
>>>
>>>    Thanks a lot.
>>>
>>> Long  
>>>
>>>
>>> Hummm, weird.
>>>
>>> Could you provide the annotate in the your LoginService class (and the 
>>> corresponding interface) ?
>>> It looks like that the CXF-SE side is not deployed correctly (and so the 
>>> HTTP component can't find it).
>>> Have you all EJB proxy requirements present in your SU zip (EJBs stub, 
>>> etc) ?
>>> Is it possible to provide your cxf-se zip file (only to my, not on the 
>>> mailing list) ?
>>>
>>> Regards
>>> JB
>>
> 

Re: How to invoke EJB and How to disable WSDL validation in http:soap-consumer/provider?

Posted by laolong <le...@sina.com>.
 I guess the problem also caused by Http/Jetty issue, the request message
cannot be processed, message content is lost due to the SOAP message POST by
XMLSpy is received with wrong method 'GET'

SMX log---------------------------------------------

DEBUG - HttpComponent                  - Receiving HTTP request: GET
/LoginServiceService/main.wsdl HTTP/1.1
Accept: */*
User-Agent: XML Spy
Host: bjc-d-xp:8199
Connection: Keep-Alive
Cache-Control: no-cache


DEBUG - JettyContextManager            - Dispatching job:
SCEP@10234051[d=true,io=0,w=true,b=false|false]
DEBUG - JettyContextManager            - Dispatching job:
SCEP@10234051[d=true,io=1,w=true,b=false|false]
DEBUG - JettyContextManager            - Dispatching job:
SCEP@10234051[d=true,io=1,w=true,b=false|false]
DEBUG - HttpComponent                  - Receiving HTTP request: GET
/LoginServiceService/ HTTP/1.1
User-Agent: XML Spy
SOAPAction: "urn:Login"
Host: localhost:8199
Connection: Keep-Alive
Cache-Control: no-cache


DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
interceptor
org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor
INFO  - PhaseInterceptorChain          - Interceptor has thrown exception,
unwinding now
java.lang.NullPointerException: InputStream content not found
	at
org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor.handleMessage(AttachmentsInInterceptor.java:46)
	at
org.apache.servicemix.soap.core.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:85)
	at
org.apache.servicemix.http.endpoints.HttpSoapConsumerMarshaler.createExchange(HttpSoapConsumerMarshaler.java:107)
	at
org.apache.servicemix.http.endpoints.HttpConsumerEndpoint.createExchange(HttpConsumerEndpoint.java:488)
	at
org.apache.servicemix.http.endpoints.HttpConsumerEndpoint.process(HttpConsumerEndpoint.java:293)
	at
org.apache.servicemix.http.HttpBridgeServlet.service(HttpBridgeServlet.java:56)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:363)
	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
	at
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
	at
org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
	at org.mortbay.jetty.Server.handle(Server.java:324)
	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534)
	at
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:864)
	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:533)
	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:207)
	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:403)
	at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
	at
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:522)
DEBUG - PhaseInterceptorChain          - Invoking handleFault on interceptor
org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor
DEBUG - HttpSoapConsumerMarshaler      - Using default response content
encoding.
DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
interceptor org.apache.servicemix.soap.interceptors.xml.StaxOutInterceptor
DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
interceptor
org.apache.servicemix.soap.bindings.soap.interceptors.SoapOutInterceptor
DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
interceptor
org.apache.servicemix.soap.bindings.soap.interceptors.SoapFaultOutInterceptor


Jean-Baptiste Onofré wrote:
> 
> Hi Long,
> 
> In your CXF-SE xbean.xml, I see that you try to make the JNDI lookup on 
> a Weblogic application server.
> 
> Nevertheless, I can't see the weblogic.jar file into your SU lib
> directory.
> 
> To be able to make JNDI lookup and RMI-IIOP, you need the weblogic 
> client lib.
> 
> In your pom.xml, you should have a dependency like this:
> 
> <dependency>
>    <groupId>com.oracle.weblogic</groupId>
>    <artifactId>server</artifactId>
>    <version>10.3</version>
> </dependency>
> 
> You can install the weblogic.jar into your maven working copy using:
> mvn install:install-file -DgroupId=com.oracle.weblogic 
> -DartifactId=server -Dfile=$WLS_HOME/server/lib/weblogic.jar 
> -Dversion=10.3 -Dpackaging=jar
> 
> Could you make a try adding the weblogic.jar into the SU ?
> 
> Regards
> JB
> 
> laolong wrote:
>>  Hi JB,
>>     
>>      http://www.nabble.com/file/p23978791/demo.zip demo.zip 
>> 
>>     I built a test EJB but got same error again, all java code and bean
>> defination are in attached, could you please review it?
>>     
>>     I'm sorry that cannot find a way to send email with attachement to
>> you
>> alone, so I have to use 'Reply' page to upload the file.
>> 
>>    Thanks a lot.
>> 
>> Long  
>> 
>> 
>> Hummm, weird.
>> 
>> Could you provide the annotate in the your LoginService class (and the 
>> corresponding interface) ?
>> It looks like that the CXF-SE side is not deployed correctly (and so the 
>> HTTP component can't find it).
>> Have you all EJB proxy requirements present in your SU zip (EJBs stub, 
>> etc) ?
>> Is it possible to provide your cxf-se zip file (only to my, not on the 
>> mailing list) ?
>> 
>> Regards
>> JB
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-invoke-EJB-and-How-to-disable-WSDL-validation-in-http%3Asoap-consumer-provider--tp23963883p23992026.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: How to invoke EJB and How to disable WSDL validation in http:soap-consumer/provider?

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Long,

In your CXF-SE xbean.xml, I see that you try to make the JNDI lookup on 
a Weblogic application server.

Nevertheless, I can't see the weblogic.jar file into your SU lib directory.

To be able to make JNDI lookup and RMI-IIOP, you need the weblogic 
client lib.

In your pom.xml, you should have a dependency like this:

<dependency>
   <groupId>com.oracle.weblogic</groupId>
   <artifactId>server</artifactId>
   <version>10.3</version>
</dependency>

You can install the weblogic.jar into your maven working copy using:
mvn install:install-file -DgroupId=com.oracle.weblogic 
-DartifactId=server -Dfile=$WLS_HOME/server/lib/weblogic.jar 
-Dversion=10.3 -Dpackaging=jar

Could you make a try adding the weblogic.jar into the SU ?

Regards
JB

laolong wrote:
>  Hi JB,
>     
>      http://www.nabble.com/file/p23978791/demo.zip demo.zip 
> 
>     I built a test EJB but got same error again, all java code and bean
> defination are in attached, could you please review it?
>     
>     I'm sorry that cannot find a way to send email with attachement to you
> alone, so I have to use 'Reply' page to upload the file.
> 
>    Thanks a lot.
> 
> Long  
> 
> 
> Hummm, weird.
> 
> Could you provide the annotate in the your LoginService class (and the 
> corresponding interface) ?
> It looks like that the CXF-SE side is not deployed correctly (and so the 
> HTTP component can't find it).
> Have you all EJB proxy requirements present in your SU zip (EJBs stub, 
> etc) ?
> Is it possible to provide your cxf-se zip file (only to my, not on the 
> mailing list) ?
> 
> Regards
> JB

Re: How to invoke EJB and How to disable WSDL validation in http:soap-consumer/provider?

Posted by laolong <le...@sina.com>.
 Hi JB,
    
     http://www.nabble.com/file/p23978791/demo.zip demo.zip 

    I built a test EJB but got same error again, all java code and bean
defination are in attached, could you please review it?
    
    I'm sorry that cannot find a way to send email with attachement to you
alone, so I have to use 'Reply' page to upload the file.

   Thanks a lot.

Long  


Hummm, weird.

Could you provide the annotate in the your LoginService class (and the 
corresponding interface) ?
It looks like that the CXF-SE side is not deployed correctly (and so the 
HTTP component can't find it).
Have you all EJB proxy requirements present in your SU zip (EJBs stub, 
etc) ?
Is it possible to provide your cxf-se zip file (only to my, not on the 
mailing list) ?

Regards
JB
-- 
View this message in context: http://www.nabble.com/How-to-invoke-EJB-and-How-to-disable-WSDL-validation-in-http%3Asoap-consumer-provider--tp23963883p23978791.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: How to invoke EJB and How to disable WSDL validation in http:soap-consumer/provider?

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hummm, weird.

Could you provide the annotate in the your LoginService class (and the 
corresponding interface) ?
It looks like that the CXF-SE side is not deployed correctly (and so the 
HTTP component can't find it).
Have you all EJB proxy requirements present in your SU zip (EJBs stub, 
etc) ?
Is it possible to provide your cxf-se zip file (only to my, not on the 
mailing list) ?

Regards
JB

laolong wrote:
> Hi JB,
> 
>    Thanks for your help, I added cxfse service/endpoint and change
> validateWsdl='no' but still cannot get it work. attached is source code.
> 
> SMX log:
> 
> DEBUG - AutoDeploymentService          - SA dependencies: [servicemix-http,
> servicemix-cxf-se]
> DEBUG - DeploymentService              - Moving
> E:\progress\fuse-esb-3.4.0.2\data\smx\tmp\ejb-sa-1.0-SNAPSHOT.0.tmp to
> E:\progress\fuse-esb-3.4.0.2\data\smx\service-assemblies\ejb-sa\version_1\install
> DEBUG - DeploymentService              - Unpack service unit archive
> E:\progress\fuse-esb-3.4.0.2\data\smx\service-assemblies\ejb-sa\version_1\install\ejb-cxf-su-1.0-SNAPSHOT.zip
> to
> E:\progress\fuse-esb-3.4.0.2\data\smx\service-assemblies\ejb-sa\version_1\sus\servicemix-cxf-se\ejb-cxf-su
> DEBUG - CxfSeComponent                 - Deploying service unit
> DEBUG - CxfSeComponent                 - Looking for
> E:\progress\fuse-esb-3.4.0.2\data\smx\service-assemblies\ejb-sa\version_1\sus\servicemix-cxf-se\ejb-cxf-su\xbean.xml:
> true
> -----------------------proxy:null
> DEBUG - CxfSeComponent                 - Service unit deployed
> DEBUG - DeploymentService              - Unpack service unit archive
> E:\progress\fuse-esb-3.4.0.2\data\smx\service-assemblies\ejb-sa\version_1\install\ejb-http-su-1.0-SNAPSHOT.zip
> to
> E:\progress\fuse-esb-3.4.0.2\data\smx\service-assemblies\ejb-sa\version_1\sus\servicemix-http\ejb-http-su
> 2009-6-11 13:18:38
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean
> buildServiceFromClass
> 信息: Creating Service {http://demo/servicemix}LoginServiceService from class
> demo.LoginService
> 2009-6-11 13:18:38 org.apache.cxf.configuration.spring.ConfigurerImpl
> getBeanName
> 信息: Could not determine bean name for instance of class
> org.apache.cxf.transport.jbi.JBIDestination.
> 2009-6-11 13:18:38 org.apache.cxf.endpoint.ServerImpl initDestination
> 信息: Setting the server's publish address to be
> jbi://ID-192-168-83-151-121cd939b54-25-5
> DEBUG - HttpComponent                  - Deploying service unit
> DEBUG - HttpComponent                  - Looking for
> E:\progress\fuse-esb-3.4.0.2\data\smx\service-assemblies\ejb-sa\version_1\sus\servicemix-http\ejb-http-su\xbean.xml:
> true
> DEBUG - HttpComponent                  - Service unit deployed
> INFO  - ServiceAssemblyLifeCycle       - Starting service assembly: ejb-sa
> INFO  - ServiceUnitLifeCycle           - Initializing service unit:
> ejb-cxf-su
> DEBUG - CxfSeComponent                 - Initializing service unit
> DEBUG - ComponentContextImpl           - Component: servicemix-cxf-se
> activated endpoint: {http://demo/servicemix}LoginServiceService :
> LoginServicePort
> DEBUG - CxfSeComponent                 - Querying service description for
> ServiceEndpoint[service={http://demo/servicemix}LoginServiceService,endpoint=LoginServicePort]
> DEBUG - CxfSeComponent                 - No description found for
> {http://demo/servicemix}LoginServiceService:LoginServicePort
> DEBUG - WSDL1Processor                 - Endpoint
> ServiceEndpoint[service={http://demo/servicemix}LoginServiceService,endpoint=LoginServicePort]
> has no service description
> DEBUG - CxfSeComponent                 - Querying service description for
> ServiceEndpoint[service={http://demo/servicemix}LoginServiceService,endpoint=LoginServicePort]
> DEBUG - CxfSeComponent                 - No description found for
> {http://demo/servicemix}LoginServiceService:LoginServicePort
> DEBUG - WSDL2Processor                 - Endpoint
> ServiceEndpoint[service={http://demo/servicemix}LoginServiceService,endpoint=LoginServicePort]
> has no service description
> DEBUG - CxfSeComponent                 - Service unit initialized
> INFO  - ServiceUnitLifeCycle           - Initializing service unit:
> ejb-http-su
> DEBUG - HttpComponent                  - Initializing service unit
> DEBUG - JCAFlow                        - ServiceMix: broadcasting info for
> org.apache.servicemix.jbi.event.EndpointEvent[source=ServiceEndpoint[service={http://demo/servicemix}LoginServiceService,endpoint=LoginServicePort]]
> DEBUG - JMSFlow                        - ServiceMix: broadcasting info for
> org.apache.servicemix.jbi.event.EndpointEvent[source=ServiceEndpoint[service={http://demo/servicemix}LoginServiceService,endpoint=LoginServicePort]]
> DEBUG - HttpComponent                  - Service unit initialized
> INFO  - ServiceUnitLifeCycle           - Starting service unit: ejb-cxf-su
> DEBUG - CxfSeComponent                 - Starting service unit
> DEBUG - CxfSeComponent                 - Unable to inject ComponentContext:
> demo.LoginServiceImpl.setContext(javax.jbi.component.ComponentContext)
> DEBUG - CxfSeComponent                 - Service unit started
> INFO  - ServiceUnitLifeCycle           - Starting service unit: ejb-http-su
> DEBUG - HttpComponent                  - Starting service unit
> DEBUG - HttpComponent                  - Service unit started
> INFO  - AutoDeploymentService          - Directory: hotdeploy: Finished
> installation of archive:  ejb-sa-1.0-SNAPSHOT.jar
> 
> 
>    1. http su still check the wsdl file
> 
> <jbi-task xmlns="http://java.sun.com/xml/ns/jbi/management-message"
> version="1.0">
> <jbi-task-result>
> <frmwk-task-result>
> <frmwk-task-result-details>
> <task-result-details>
> <task-id>start</task-id>
> <task-result>FAILED</task-result>
> <message-type>ERROR</message-type>
> </task-result-details>
> </frmwk-task-result-details>
> </frmwk-task-result>
> <component-task-result>
> <component-name>servicemix-http</component-name>
> <component-task-result-details>
> <task-result-details>
> <task-id>start</task-id>
> <task-result>FAILED</task-result>
> <message-type>ERROR</message-type>
> <task-status-msg>
> <msg-loc-info>
> <loc-token/>
> <loc-message>Unable to parse result string</loc-message>
> </msg-loc-info>
> </task-status-msg>
> <exception-info>
> <nesting-level>1</nesting-level>
> <loc-token/>
> <loc-message>Could not find service
> '{http://demo/servicemix}LoginServiceService' in wsdl</loc-message>
> <stack-trace><![CDATA[javax.jbi.management.DeploymentException: Could not
> find service '{http://demo/servicemix}LoginServiceService' in wsdl
> 
> 	at
> org.apache.servicemix.http.endpoints.HttpSoapConsumerEndpoint.validateWsdl1(HttpSoapConsumerEndpoint.java:374)
> 
> 	at
> org.apache.servicemix.http.endpoints.HttpSoapConsumerEndpoint.activate(HttpSoapConsumerEndpoint.java:318)
> 
> 	at
> org.apache.servicemix.common.DefaultServiceUnit.init(DefaultServiceUnit.java:54)
> 
> 	at
> org.apache.servicemix.common.BaseServiceUnitManager.init(BaseServiceUnitManager.java:122)
> 
> 	at
> org.apache.servicemix.jbi.framework.ServiceUnitLifeCycle.init(ServiceUnitLifeCycle.java:85)
> 
> 	at
> org.apache.servicemix.jbi.framework.ServiceAssemblyLifeCycle.start(ServiceAssemblyLifeCycle.java:145)
> 
> 	at
> org.apache.servicemix.jbi.framework.DeploymentService.start(DeploymentService.java:390)
> 
> 	at
> org.apache.servicemix.jbi.framework.AutoDeploymentService.updateServiceAssembly(AutoDeploymentService.java:351)
> 
> 	at
> org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchive(AutoDeploymentService.java:255)
> 
> 	at
> org.apache.servicemix.jbi.framework.AutoDeploymentService.monitorDirectory(AutoDeploymentService.java:658)
> 
> 	at
> org.apache.servicemix.jbi.framework.AutoDeploymentService.access$800(AutoDeploymentService.java:63)
> 
> 	at
> org.apache.servicemix.jbi.framework.AutoDeploymentService$1.run(AutoDeploymentService.java:622)
> 
> 	at java.util.TimerThread.mainLoop(Timer.java:512)
> 
> 	at java.util.TimerThread.run(Timer.java:462)
> 
> ]]></stack-trace>
> </exception-info>
> </task-result-details>
> </component-task-result-details>
> </component-task-result>
> </jbi-task-result>
> </jbi-task>
> 
> 	at
> org.apache.servicemix.jbi.framework.ManagementSupport.failure(ManagementSupport.java:125)
> 	at
> org.apache.servicemix.jbi.framework.ManagementSupport.failure(ManagementSupport.java:111)
> 	at
> org.apache.servicemix.jbi.framework.ServiceAssemblyLifeCycle.start(ServiceAssemblyLifeCycle.java:168)
> 	at
> org.apache.servicemix.jbi.framework.DeploymentService.start(DeploymentService.java:390)
> 	at
> org.apache.servicemix.jbi.framework.AutoDeploymentService.updateServiceAssembly(AutoDeploymentService.java:351)
> 	... 6 more
> DEBUG - JMSFlow                        - ServiceMix: broadcasting info for
> org.apache.servicemix.jbi.event.EndpointEvent[source=ServiceEndpoint[service={http://demo/servicemix}LoginServiceService,endpoint=LoginServicePort]]
>   
>     2. If I create a wsdl file to match HTTP su service and endpoint, the su
> can be deployed but get  error message as below when access the service.
> 
> DEBUG - HttpComponent                  - Receiving HTTP request: GET
> /LoginServiceService/ HTTP/1.1
> Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
> application/x-shockwave-flash, */*
> Accept-Language: zh-cn
> Accept-Encoding: gzip, deflate
> User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; MAXTHON
> 2.0)
> Host: bjc-d-leonf-xp:8199
> Connection: Keep-Alive
> 
> 
> isUserJbiWrapper------------------true
> DEBUG - PhaseInterceptorChain          - Adding interceptor
> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor
> DEBUG - PhaseInterceptorChain          - Adding interceptor
> org.apache.servicemix.soap.interceptors.xml.StaxInInterceptor
> DEBUG - PhaseInterceptorChain          - Adding interceptor
> org.apache.servicemix.soap.bindings.soap.interceptors.SoapInInterceptor
> DEBUG - PhaseInterceptorChain          - Adding interceptor
> org.apache.servicemix.soap.bindings.soap.interceptors.SoapActionInOperationInterceptor
> DEBUG - PhaseInterceptorChain          - Adding interceptor
> org.apache.servicemix.soap.interceptors.wsdl.WsdlOperationInInterceptor
> DEBUG - PhaseInterceptorChain          - Adding interceptor
> org.apache.servicemix.soap.bindings.soap.interceptors.MustUnderstandInterceptor
> DEBUG - PhaseInterceptorChain          - Adding interceptor
> org.apache.servicemix.soap.interceptors.jbi.JbiInWsdl1Interceptor
> DEBUG - PhaseInterceptorChain          - Adding interceptor
> org.apache.servicemix.soap.interceptors.jbi.JbiInInterceptor
> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
> interceptor
> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor
> INFO  - PhaseInterceptorChain          - Interceptor has thrown exception,
> unwinding now
> java.lang.NullPointerException: InputStream content not found
> 	at
> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor.handleMessage(AttachmentsInInterceptor.java:46)
> 	at
> org.apache.servicemix.soap.core.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:85)
> 	at
> org.apache.servicemix.http.endpoints.HttpSoapConsumerMarshaler.createExchange(HttpSoapConsumerMarshaler.java:107)
> 	at demo.SoapConsumerMarshaler.createExchange(SoapConsumerMarshaler.java:29)
> 	at
> org.apache.servicemix.http.endpoints.HttpConsumerEndpoint.createExchange(HttpConsumerEndpoint.java:488)
> 	at
> org.apache.servicemix.http.endpoints.HttpConsumerEndpoint.process(HttpConsumerEndpoint.java:293)
> 	at
> org.apache.servicemix.http.HttpBridgeServlet.service(HttpBridgeServlet.java:56)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
> 	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
> 	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:363)
> 	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
> 	at
> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
> 	at
> org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
> 	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
> 	at org.mortbay.jetty.Server.handle(Server.java:324)
> 	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534)
> 	at
> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:864)
> 	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:533)
> 	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:207)
> 	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:403)
> 	at
> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
> 	at
> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:522)
> DEBUG - PhaseInterceptorChain          - Invoking handleFault on interceptor
> org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor
> DEBUG - PhaseInterceptorChain          - Adding interceptor
> org.apache.servicemix.soap.interceptors.xml.StaxOutInterceptor
> DEBUG - PhaseInterceptorChain          - Adding interceptor
> org.apache.servicemix.soap.bindings.soap.interceptors.SoapOutInterceptor
> DEBUG - PhaseInterceptorChain          - Adding interceptor
> org.apache.servicemix.soap.bindings.soap.interceptors.SoapFaultOutInterceptor
> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
> interceptor org.apache.servicemix.soap.interceptors.xml.StaxOutInterceptor
> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
> interceptor
> org.apache.servicemix.soap.bindings.soap.interceptors.SoapOutInterceptor
> DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
> interceptor
> org.apache.servicemix.soap.bindings.soap.interceptors.SoapFaultOutInterceptor
> 
>    
> 
> Jean-Baptiste Onofré wrote:
>> Hi,
>>
>> Could you please provide the complete SMX log file ?
>>
>> Could you try to define the service and endpoint in the cxfse:endpoint 
>> definition ?
>>
>> For your information, here is an EJB proxy using CXF-SE/HTTP that works 
>> (using weblogic like you as backend).
>>
>> First the CXF-SE SU xbean.xml:
>> <beans xmlns:cxfse="http://servicemix.apache.org/cxfse/1.0"
>>         xmlns:fsb="http://www.fimasys.com/fsb">
>>
>>     <bean 
>> class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
>>        <property name="locations">
>>           <value>classpath:/farm-report-service-config.properties</value>
>>        </property>
>>     </bean>
>>
>>     <cxfse:endpoint>
>>        <cxfse:service>fsb:farm-report-service</cxfse:service>
>>        <cxfse:endpoint>FarmReportServiceImplPort</cxfse:endpoint>
>>        <cxfse:pojo>
>>           <bean 
>> class="com.fimasys.fsb.services.farmreport.FarmReportServiceImpl">
>>              <property name="urlProvider"
>> value="${farm.jndiUrlProvider}"/>
>>              <property name="jndiContextFactory" 
>> value="${farm.jndiContextFactory}"/>
>>           </bean>
>>        </cxfse:pojo>
>>     </cxfse:endpoint>
>>
>> The FarmReportServiceImpl is the EJB client:
>> @WebService(serviceName = "farm-report-service", targetNamespace = 
>> "http://www.fimasys.com/fsb", endpointInterface = 
>> "com.fimasys.fsb.services.farmreport.FarmReportService")
>> public class FarmReportServiceImpl implements FarmReportService {
>> ...
>> }
>>
>> @WebService(targetNamespace = "http://www.fimasys.com/fsb", name = 
>> "FarmReportService")
>> public interface FarmReportService {
>>
>> 	/**
>> 	 * @param reportCode the report code (mandatory)
>> 	 * @param applicationCode the application code (mandatory)
>> 	 * @param mediaType the media type (optional)
>> 	 * @param asynchronousTimeout the asynchronous timeout (optional)
>> 	 * @param reportParameters the parameters specific to this report 
>> (optional)
>> 	 * @return the result as a byte array, may be null as some report do 
>> not return an output stream
>> 	 * @throws ReportingException
>> 	 */
>> 	public byte[] executeReport( @WebParam(name="reportCode") String 
>> reportCode,
>> 	                             @WebParam(name="applicationCode") String 
>> applicationCode,
>> 	                             @WebParam(name="mediaType") String
>> mediaType,
>> 	                             @WebParam(name="asynchronousTimeout") 
>> Integer asynchronousTimeout,
>> 	                             @WebParam(name="reportParameters") 
>> List<ReportParameter> reportParameters) throws ReportingException;
>>
>> }
>>
>> On the HTTP SU, I have the xbean.xml:
>>
>> 	<http:soap-consumer service="fsb:farm-report-service"
>> 	                    endpoint="fsb:farm-report-service-http"
>> 	                    targetService="fsb:farm-report-service"
>> 	                    targetEndpoint="FarmReportServiceImplPort"
>> 	                    locationURI="${service.locationURI}"
>> 	                    wsdl="classpath:farm-report.wsdl"
>> 	                    validateWsdl="no"/>
>>
>>
>> Regards
>> JB
>>
>> laolong wrote:
>>> Hi
>>>
>>>    I'm a newcomer of servicemix, I'm going to make a EJB proxy to expose
>>> my
>>> EJB as webservice, but always get 'Cound not find port LoginServicePort
>>> in
>>> wsdl for service {http://demo/servicemix}LoginService' error since
>>> loginservice.wsdl is a 'fake' WSDL , looks like validateWsdl="false" is
>>> not
>>> working, how can I disable it?
>>>
>>>   My code is created according to ServiceMix Tutorials ---Using EJB
>>> inside
>>> ServiceMix(http://cwiki.apache.org/SM/6-intermediate-using-ejb-inside-servicemix.html)
>>>
>>>   It will be great help to provide a working example of EJB proxy, thanks
>>> in
>>> advance!
>>>
>>> ejb-http-su xbean.xml
>>> <beans xmlns:http="http://servicemix.apache.org/http/1.0"
>>>        xmlns:tns="http://demo/servicemix">
>>> <http:soap-consumer
>>> 		service="tns:LoginService"
>>> 		endpoint="ep"
>>> 		targetService="tns:LoginService"
>>> 		targetEndpoint="LoginServicePort"
>>> 		defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
>>> 		locationURI="http://0.0.0.0:8199/LoginServiceService"
>>> 		wsdl="classpath:loginservice.wsdl"
>>> 		validateWsdl="false"
>>> 		useJbiWrapper="true"
>>>   />
>>> </beans>
>>>
>>>
>>> cxfse xbean.xml
>>> <beans xmlns:cxfse="http://servicemix.apache.org/cxfse/1.0"
>>>        xmlns:tns="http://demo/servicemix">
>>>
>>>    <bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
>>>       <property name="environment">
>>>          <props>
>>>             <prop key="java.naming.factory.initial">
>>>                weblogic.jndi.WLInitialContextFactory
>>>             </prop>
>>>             <prop key="java.naming.provider.url">
>>>                t3://192.168.80.111:7001
>>>             </prop>
>>>          </props>
>>>       </property>
>>>    </bean>
>>>
>>>    <bean id="ejbProxy"
>>> class="org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean">
>>>       <property name="jndiName" value="demo/UserDAORemote"/>
>>>       <property name="businessInterface" value="demo.UserDAORemote"/>
>>>       <property name="homeInterface" value="demo.UserDAORemoteHome"/>
>>>       <property name="refreshHomeOnConnectFailure" value="true"/>
>>>       <property name="cacheHome" value="true"/>
>>>       <property name="lookupHomeOnStartup" value="false"/>
>>>       <property name="resourceRef" value="true"/>
>>>       <property name="jndiTemplate" ref="jndiTemplate"/>
>>>    </bean>
>>>
>>>    <cxfse:endpoint>
>>>       <cxfse:pojo>
>>>          <bean class="demo.LoginServiceImpl">
>>>             <property name="proxy" ref="ejbProxy"/>
>>>          </bean>
>>>       </cxfse:pojo>
>>>    </cxfse:endpoint>
>>>
>>> </beans>
>>
> http://www.nabble.com/file/p23975536/sm-ejb-proxy.zip sm-ejb-proxy.zip 

Re: How to invoke EJB and How to disable WSDL validation in http:soap-consumer/provider?

Posted by laolong <le...@sina.com>.
Hi JB,

   Thanks for your help, I added cxfse service/endpoint and change
validateWsdl='no' but still cannot get it work. attached is source code.

SMX log:

DEBUG - AutoDeploymentService          - SA dependencies: [servicemix-http,
servicemix-cxf-se]
DEBUG - DeploymentService              - Moving
E:\progress\fuse-esb-3.4.0.2\data\smx\tmp\ejb-sa-1.0-SNAPSHOT.0.tmp to
E:\progress\fuse-esb-3.4.0.2\data\smx\service-assemblies\ejb-sa\version_1\install
DEBUG - DeploymentService              - Unpack service unit archive
E:\progress\fuse-esb-3.4.0.2\data\smx\service-assemblies\ejb-sa\version_1\install\ejb-cxf-su-1.0-SNAPSHOT.zip
to
E:\progress\fuse-esb-3.4.0.2\data\smx\service-assemblies\ejb-sa\version_1\sus\servicemix-cxf-se\ejb-cxf-su
DEBUG - CxfSeComponent                 - Deploying service unit
DEBUG - CxfSeComponent                 - Looking for
E:\progress\fuse-esb-3.4.0.2\data\smx\service-assemblies\ejb-sa\version_1\sus\servicemix-cxf-se\ejb-cxf-su\xbean.xml:
true
-----------------------proxy:null
DEBUG - CxfSeComponent                 - Service unit deployed
DEBUG - DeploymentService              - Unpack service unit archive
E:\progress\fuse-esb-3.4.0.2\data\smx\service-assemblies\ejb-sa\version_1\install\ejb-http-su-1.0-SNAPSHOT.zip
to
E:\progress\fuse-esb-3.4.0.2\data\smx\service-assemblies\ejb-sa\version_1\sus\servicemix-http\ejb-http-su
2009-6-11 13:18:38
org.apache.cxf.service.factory.ReflectionServiceFactoryBean
buildServiceFromClass
信息: Creating Service {http://demo/servicemix}LoginServiceService from class
demo.LoginService
2009-6-11 13:18:38 org.apache.cxf.configuration.spring.ConfigurerImpl
getBeanName
信息: Could not determine bean name for instance of class
org.apache.cxf.transport.jbi.JBIDestination.
2009-6-11 13:18:38 org.apache.cxf.endpoint.ServerImpl initDestination
信息: Setting the server's publish address to be
jbi://ID-192-168-83-151-121cd939b54-25-5
DEBUG - HttpComponent                  - Deploying service unit
DEBUG - HttpComponent                  - Looking for
E:\progress\fuse-esb-3.4.0.2\data\smx\service-assemblies\ejb-sa\version_1\sus\servicemix-http\ejb-http-su\xbean.xml:
true
DEBUG - HttpComponent                  - Service unit deployed
INFO  - ServiceAssemblyLifeCycle       - Starting service assembly: ejb-sa
INFO  - ServiceUnitLifeCycle           - Initializing service unit:
ejb-cxf-su
DEBUG - CxfSeComponent                 - Initializing service unit
DEBUG - ComponentContextImpl           - Component: servicemix-cxf-se
activated endpoint: {http://demo/servicemix}LoginServiceService :
LoginServicePort
DEBUG - CxfSeComponent                 - Querying service description for
ServiceEndpoint[service={http://demo/servicemix}LoginServiceService,endpoint=LoginServicePort]
DEBUG - CxfSeComponent                 - No description found for
{http://demo/servicemix}LoginServiceService:LoginServicePort
DEBUG - WSDL1Processor                 - Endpoint
ServiceEndpoint[service={http://demo/servicemix}LoginServiceService,endpoint=LoginServicePort]
has no service description
DEBUG - CxfSeComponent                 - Querying service description for
ServiceEndpoint[service={http://demo/servicemix}LoginServiceService,endpoint=LoginServicePort]
DEBUG - CxfSeComponent                 - No description found for
{http://demo/servicemix}LoginServiceService:LoginServicePort
DEBUG - WSDL2Processor                 - Endpoint
ServiceEndpoint[service={http://demo/servicemix}LoginServiceService,endpoint=LoginServicePort]
has no service description
DEBUG - CxfSeComponent                 - Service unit initialized
INFO  - ServiceUnitLifeCycle           - Initializing service unit:
ejb-http-su
DEBUG - HttpComponent                  - Initializing service unit
DEBUG - JCAFlow                        - ServiceMix: broadcasting info for
org.apache.servicemix.jbi.event.EndpointEvent[source=ServiceEndpoint[service={http://demo/servicemix}LoginServiceService,endpoint=LoginServicePort]]
DEBUG - JMSFlow                        - ServiceMix: broadcasting info for
org.apache.servicemix.jbi.event.EndpointEvent[source=ServiceEndpoint[service={http://demo/servicemix}LoginServiceService,endpoint=LoginServicePort]]
DEBUG - HttpComponent                  - Service unit initialized
INFO  - ServiceUnitLifeCycle           - Starting service unit: ejb-cxf-su
DEBUG - CxfSeComponent                 - Starting service unit
DEBUG - CxfSeComponent                 - Unable to inject ComponentContext:
demo.LoginServiceImpl.setContext(javax.jbi.component.ComponentContext)
DEBUG - CxfSeComponent                 - Service unit started
INFO  - ServiceUnitLifeCycle           - Starting service unit: ejb-http-su
DEBUG - HttpComponent                  - Starting service unit
DEBUG - HttpComponent                  - Service unit started
INFO  - AutoDeploymentService          - Directory: hotdeploy: Finished
installation of archive:  ejb-sa-1.0-SNAPSHOT.jar


   1. http su still check the wsdl file

<jbi-task xmlns="http://java.sun.com/xml/ns/jbi/management-message"
version="1.0">
<jbi-task-result>
<frmwk-task-result>
<frmwk-task-result-details>
<task-result-details>
<task-id>start</task-id>
<task-result>FAILED</task-result>
<message-type>ERROR</message-type>
</task-result-details>
</frmwk-task-result-details>
</frmwk-task-result>
<component-task-result>
<component-name>servicemix-http</component-name>
<component-task-result-details>
<task-result-details>
<task-id>start</task-id>
<task-result>FAILED</task-result>
<message-type>ERROR</message-type>
<task-status-msg>
<msg-loc-info>
<loc-token/>
<loc-message>Unable to parse result string</loc-message>
</msg-loc-info>
</task-status-msg>
<exception-info>
<nesting-level>1</nesting-level>
<loc-token/>
<loc-message>Could not find service
'{http://demo/servicemix}LoginServiceService' in wsdl</loc-message>
<stack-trace><![CDATA[javax.jbi.management.DeploymentException: Could not
find service '{http://demo/servicemix}LoginServiceService' in wsdl

	at
org.apache.servicemix.http.endpoints.HttpSoapConsumerEndpoint.validateWsdl1(HttpSoapConsumerEndpoint.java:374)

	at
org.apache.servicemix.http.endpoints.HttpSoapConsumerEndpoint.activate(HttpSoapConsumerEndpoint.java:318)

	at
org.apache.servicemix.common.DefaultServiceUnit.init(DefaultServiceUnit.java:54)

	at
org.apache.servicemix.common.BaseServiceUnitManager.init(BaseServiceUnitManager.java:122)

	at
org.apache.servicemix.jbi.framework.ServiceUnitLifeCycle.init(ServiceUnitLifeCycle.java:85)

	at
org.apache.servicemix.jbi.framework.ServiceAssemblyLifeCycle.start(ServiceAssemblyLifeCycle.java:145)

	at
org.apache.servicemix.jbi.framework.DeploymentService.start(DeploymentService.java:390)

	at
org.apache.servicemix.jbi.framework.AutoDeploymentService.updateServiceAssembly(AutoDeploymentService.java:351)

	at
org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchive(AutoDeploymentService.java:255)

	at
org.apache.servicemix.jbi.framework.AutoDeploymentService.monitorDirectory(AutoDeploymentService.java:658)

	at
org.apache.servicemix.jbi.framework.AutoDeploymentService.access$800(AutoDeploymentService.java:63)

	at
org.apache.servicemix.jbi.framework.AutoDeploymentService$1.run(AutoDeploymentService.java:622)

	at java.util.TimerThread.mainLoop(Timer.java:512)

	at java.util.TimerThread.run(Timer.java:462)

]]></stack-trace>
</exception-info>
</task-result-details>
</component-task-result-details>
</component-task-result>
</jbi-task-result>
</jbi-task>

	at
org.apache.servicemix.jbi.framework.ManagementSupport.failure(ManagementSupport.java:125)
	at
org.apache.servicemix.jbi.framework.ManagementSupport.failure(ManagementSupport.java:111)
	at
org.apache.servicemix.jbi.framework.ServiceAssemblyLifeCycle.start(ServiceAssemblyLifeCycle.java:168)
	at
org.apache.servicemix.jbi.framework.DeploymentService.start(DeploymentService.java:390)
	at
org.apache.servicemix.jbi.framework.AutoDeploymentService.updateServiceAssembly(AutoDeploymentService.java:351)
	... 6 more
DEBUG - JMSFlow                        - ServiceMix: broadcasting info for
org.apache.servicemix.jbi.event.EndpointEvent[source=ServiceEndpoint[service={http://demo/servicemix}LoginServiceService,endpoint=LoginServicePort]]
  
    2. If I create a wsdl file to match HTTP su service and endpoint, the su
can be deployed but get  error message as below when access the service.

DEBUG - HttpComponent                  - Receiving HTTP request: GET
/LoginServiceService/ HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/x-shockwave-flash, */*
Accept-Language: zh-cn
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; MAXTHON
2.0)
Host: bjc-d-leonf-xp:8199
Connection: Keep-Alive


isUserJbiWrapper------------------true
DEBUG - PhaseInterceptorChain          - Adding interceptor
org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor
DEBUG - PhaseInterceptorChain          - Adding interceptor
org.apache.servicemix.soap.interceptors.xml.StaxInInterceptor
DEBUG - PhaseInterceptorChain          - Adding interceptor
org.apache.servicemix.soap.bindings.soap.interceptors.SoapInInterceptor
DEBUG - PhaseInterceptorChain          - Adding interceptor
org.apache.servicemix.soap.bindings.soap.interceptors.SoapActionInOperationInterceptor
DEBUG - PhaseInterceptorChain          - Adding interceptor
org.apache.servicemix.soap.interceptors.wsdl.WsdlOperationInInterceptor
DEBUG - PhaseInterceptorChain          - Adding interceptor
org.apache.servicemix.soap.bindings.soap.interceptors.MustUnderstandInterceptor
DEBUG - PhaseInterceptorChain          - Adding interceptor
org.apache.servicemix.soap.interceptors.jbi.JbiInWsdl1Interceptor
DEBUG - PhaseInterceptorChain          - Adding interceptor
org.apache.servicemix.soap.interceptors.jbi.JbiInInterceptor
DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
interceptor
org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor
INFO  - PhaseInterceptorChain          - Interceptor has thrown exception,
unwinding now
java.lang.NullPointerException: InputStream content not found
	at
org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor.handleMessage(AttachmentsInInterceptor.java:46)
	at
org.apache.servicemix.soap.core.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:85)
	at
org.apache.servicemix.http.endpoints.HttpSoapConsumerMarshaler.createExchange(HttpSoapConsumerMarshaler.java:107)
	at demo.SoapConsumerMarshaler.createExchange(SoapConsumerMarshaler.java:29)
	at
org.apache.servicemix.http.endpoints.HttpConsumerEndpoint.createExchange(HttpConsumerEndpoint.java:488)
	at
org.apache.servicemix.http.endpoints.HttpConsumerEndpoint.process(HttpConsumerEndpoint.java:293)
	at
org.apache.servicemix.http.HttpBridgeServlet.service(HttpBridgeServlet.java:56)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:363)
	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
	at
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
	at
org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
	at org.mortbay.jetty.Server.handle(Server.java:324)
	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534)
	at
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:864)
	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:533)
	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:207)
	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:403)
	at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
	at
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:522)
DEBUG - PhaseInterceptorChain          - Invoking handleFault on interceptor
org.apache.servicemix.soap.interceptors.mime.AttachmentsInInterceptor
DEBUG - PhaseInterceptorChain          - Adding interceptor
org.apache.servicemix.soap.interceptors.xml.StaxOutInterceptor
DEBUG - PhaseInterceptorChain          - Adding interceptor
org.apache.servicemix.soap.bindings.soap.interceptors.SoapOutInterceptor
DEBUG - PhaseInterceptorChain          - Adding interceptor
org.apache.servicemix.soap.bindings.soap.interceptors.SoapFaultOutInterceptor
DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
interceptor org.apache.servicemix.soap.interceptors.xml.StaxOutInterceptor
DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
interceptor
org.apache.servicemix.soap.bindings.soap.interceptors.SoapOutInterceptor
DEBUG - PhaseInterceptorChain          - Invoking handleMessage on
interceptor
org.apache.servicemix.soap.bindings.soap.interceptors.SoapFaultOutInterceptor

   

Jean-Baptiste Onofré wrote:
> 
> Hi,
> 
> Could you please provide the complete SMX log file ?
> 
> Could you try to define the service and endpoint in the cxfse:endpoint 
> definition ?
> 
> For your information, here is an EJB proxy using CXF-SE/HTTP that works 
> (using weblogic like you as backend).
> 
> First the CXF-SE SU xbean.xml:
> <beans xmlns:cxfse="http://servicemix.apache.org/cxfse/1.0"
>         xmlns:fsb="http://www.fimasys.com/fsb">
> 
>     <bean 
> class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
>        <property name="locations">
>           <value>classpath:/farm-report-service-config.properties</value>
>        </property>
>     </bean>
> 
>     <cxfse:endpoint>
>        <cxfse:service>fsb:farm-report-service</cxfse:service>
>        <cxfse:endpoint>FarmReportServiceImplPort</cxfse:endpoint>
>        <cxfse:pojo>
>           <bean 
> class="com.fimasys.fsb.services.farmreport.FarmReportServiceImpl">
>              <property name="urlProvider"
> value="${farm.jndiUrlProvider}"/>
>              <property name="jndiContextFactory" 
> value="${farm.jndiContextFactory}"/>
>           </bean>
>        </cxfse:pojo>
>     </cxfse:endpoint>
> 
> The FarmReportServiceImpl is the EJB client:
> @WebService(serviceName = "farm-report-service", targetNamespace = 
> "http://www.fimasys.com/fsb", endpointInterface = 
> "com.fimasys.fsb.services.farmreport.FarmReportService")
> public class FarmReportServiceImpl implements FarmReportService {
> ...
> }
> 
> @WebService(targetNamespace = "http://www.fimasys.com/fsb", name = 
> "FarmReportService")
> public interface FarmReportService {
> 
> 	/**
> 	 * @param reportCode the report code (mandatory)
> 	 * @param applicationCode the application code (mandatory)
> 	 * @param mediaType the media type (optional)
> 	 * @param asynchronousTimeout the asynchronous timeout (optional)
> 	 * @param reportParameters the parameters specific to this report 
> (optional)
> 	 * @return the result as a byte array, may be null as some report do 
> not return an output stream
> 	 * @throws ReportingException
> 	 */
> 	public byte[] executeReport( @WebParam(name="reportCode") String 
> reportCode,
> 	                             @WebParam(name="applicationCode") String 
> applicationCode,
> 	                             @WebParam(name="mediaType") String
> mediaType,
> 	                             @WebParam(name="asynchronousTimeout") 
> Integer asynchronousTimeout,
> 	                             @WebParam(name="reportParameters") 
> List<ReportParameter> reportParameters) throws ReportingException;
> 
> }
> 
> On the HTTP SU, I have the xbean.xml:
> 
> 	<http:soap-consumer service="fsb:farm-report-service"
> 	                    endpoint="fsb:farm-report-service-http"
> 	                    targetService="fsb:farm-report-service"
> 	                    targetEndpoint="FarmReportServiceImplPort"
> 	                    locationURI="${service.locationURI}"
> 	                    wsdl="classpath:farm-report.wsdl"
> 	                    validateWsdl="no"/>
> 
> 
> Regards
> JB
> 
> laolong wrote:
>> Hi
>> 
>>    I'm a newcomer of servicemix, I'm going to make a EJB proxy to expose
>> my
>> EJB as webservice, but always get 'Cound not find port LoginServicePort
>> in
>> wsdl for service {http://demo/servicemix}LoginService' error since
>> loginservice.wsdl is a 'fake' WSDL , looks like validateWsdl="false" is
>> not
>> working, how can I disable it?
>> 
>>   My code is created according to ServiceMix Tutorials ---Using EJB
>> inside
>> ServiceMix(http://cwiki.apache.org/SM/6-intermediate-using-ejb-inside-servicemix.html)
>> 
>>   It will be great help to provide a working example of EJB proxy, thanks
>> in
>> advance!
>> 
>> ejb-http-su xbean.xml
>> <beans xmlns:http="http://servicemix.apache.org/http/1.0"
>>        xmlns:tns="http://demo/servicemix">
>> <http:soap-consumer
>> 		service="tns:LoginService"
>> 		endpoint="ep"
>> 		targetService="tns:LoginService"
>> 		targetEndpoint="LoginServicePort"
>> 		defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
>> 		locationURI="http://0.0.0.0:8199/LoginServiceService"
>> 		wsdl="classpath:loginservice.wsdl"
>> 		validateWsdl="false"
>> 		useJbiWrapper="true"
>>   />
>> </beans>
>> 
>> 
>> cxfse xbean.xml
>> <beans xmlns:cxfse="http://servicemix.apache.org/cxfse/1.0"
>>        xmlns:tns="http://demo/servicemix">
>> 
>>    <bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
>>       <property name="environment">
>>          <props>
>>             <prop key="java.naming.factory.initial">
>>                weblogic.jndi.WLInitialContextFactory
>>             </prop>
>>             <prop key="java.naming.provider.url">
>>                t3://192.168.80.111:7001
>>             </prop>
>>          </props>
>>       </property>
>>    </bean>
>> 
>>    <bean id="ejbProxy"
>> class="org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean">
>>       <property name="jndiName" value="demo/UserDAORemote"/>
>>       <property name="businessInterface" value="demo.UserDAORemote"/>
>>       <property name="homeInterface" value="demo.UserDAORemoteHome"/>
>>       <property name="refreshHomeOnConnectFailure" value="true"/>
>>       <property name="cacheHome" value="true"/>
>>       <property name="lookupHomeOnStartup" value="false"/>
>>       <property name="resourceRef" value="true"/>
>>       <property name="jndiTemplate" ref="jndiTemplate"/>
>>    </bean>
>> 
>>    <cxfse:endpoint>
>>       <cxfse:pojo>
>>          <bean class="demo.LoginServiceImpl">
>>             <property name="proxy" ref="ejbProxy"/>
>>          </bean>
>>       </cxfse:pojo>
>>    </cxfse:endpoint>
>> 
>> </beans>
> 
> 
http://www.nabble.com/file/p23975536/sm-ejb-proxy.zip sm-ejb-proxy.zip 
-- 
View this message in context: http://www.nabble.com/How-to-invoke-EJB-and-How-to-disable-WSDL-validation-in-http%3Asoap-consumer-provider--tp23963883p23975536.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: How to invoke EJB and How to disable WSDL validation in http:soap-consumer/provider?

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,

Could you please provide the complete SMX log file ?

Could you try to define the service and endpoint in the cxfse:endpoint 
definition ?

For your information, here is an EJB proxy using CXF-SE/HTTP that works 
(using weblogic like you as backend).

First the CXF-SE SU xbean.xml:
<beans xmlns:cxfse="http://servicemix.apache.org/cxfse/1.0"
        xmlns:fsb="http://www.fimasys.com/fsb">

    <bean 
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
       <property name="locations">
          <value>classpath:/farm-report-service-config.properties</value>
       </property>
    </bean>

    <cxfse:endpoint>
       <cxfse:service>fsb:farm-report-service</cxfse:service>
       <cxfse:endpoint>FarmReportServiceImplPort</cxfse:endpoint>
       <cxfse:pojo>
          <bean 
class="com.fimasys.fsb.services.farmreport.FarmReportServiceImpl">
             <property name="urlProvider" value="${farm.jndiUrlProvider}"/>
             <property name="jndiContextFactory" 
value="${farm.jndiContextFactory}"/>
          </bean>
       </cxfse:pojo>
    </cxfse:endpoint>

The FarmReportServiceImpl is the EJB client:
@WebService(serviceName = "farm-report-service", targetNamespace = 
"http://www.fimasys.com/fsb", endpointInterface = 
"com.fimasys.fsb.services.farmreport.FarmReportService")
public class FarmReportServiceImpl implements FarmReportService {
...
}

@WebService(targetNamespace = "http://www.fimasys.com/fsb", name = 
"FarmReportService")
public interface FarmReportService {

	/**
	 * @param reportCode the report code (mandatory)
	 * @param applicationCode the application code (mandatory)
	 * @param mediaType the media type (optional)
	 * @param asynchronousTimeout the asynchronous timeout (optional)
	 * @param reportParameters the parameters specific to this report 
(optional)
	 * @return the result as a byte array, may be null as some report do 
not return an output stream
	 * @throws ReportingException
	 */
	public byte[] executeReport( @WebParam(name="reportCode") String 
reportCode,
	                             @WebParam(name="applicationCode") String 
applicationCode,
	                             @WebParam(name="mediaType") String mediaType,
	                             @WebParam(name="asynchronousTimeout") 
Integer asynchronousTimeout,
	                             @WebParam(name="reportParameters") 
List<ReportParameter> reportParameters) throws ReportingException;

}

On the HTTP SU, I have the xbean.xml:

	<http:soap-consumer service="fsb:farm-report-service"
	                    endpoint="fsb:farm-report-service-http"
	                    targetService="fsb:farm-report-service"
	                    targetEndpoint="FarmReportServiceImplPort"
	                    locationURI="${service.locationURI}"
	                    wsdl="classpath:farm-report.wsdl"
	                    validateWsdl="no"/>


Regards
JB

laolong wrote:
> Hi
> 
>    I'm a newcomer of servicemix, I'm going to make a EJB proxy to expose my
> EJB as webservice, but always get 'Cound not find port LoginServicePort in
> wsdl for service {http://demo/servicemix}LoginService' error since
> loginservice.wsdl is a 'fake' WSDL , looks like validateWsdl="false" is not
> working, how can I disable it?
> 
>   My code is created according to ServiceMix Tutorials ---Using EJB inside
> ServiceMix(http://cwiki.apache.org/SM/6-intermediate-using-ejb-inside-servicemix.html)
> 
>   It will be great help to provide a working example of EJB proxy, thanks in
> advance!
> 
> ejb-http-su xbean.xml
> <beans xmlns:http="http://servicemix.apache.org/http/1.0"
>        xmlns:tns="http://demo/servicemix">
> <http:soap-consumer
> 		service="tns:LoginService"
> 		endpoint="ep"
> 		targetService="tns:LoginService"
> 		targetEndpoint="LoginServicePort"
> 		defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
> 		locationURI="http://0.0.0.0:8199/LoginServiceService"
> 		wsdl="classpath:loginservice.wsdl"
> 		validateWsdl="false"
> 		useJbiWrapper="true"
>   />
> </beans>
> 
> 
> cxfse xbean.xml
> <beans xmlns:cxfse="http://servicemix.apache.org/cxfse/1.0"
>        xmlns:tns="http://demo/servicemix">
> 
>    <bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
>       <property name="environment">
>          <props>
>             <prop key="java.naming.factory.initial">
>                weblogic.jndi.WLInitialContextFactory
>             </prop>
>             <prop key="java.naming.provider.url">
>                t3://192.168.80.111:7001
>             </prop>
>          </props>
>       </property>
>    </bean>
> 
>    <bean id="ejbProxy"
> class="org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean">
>       <property name="jndiName" value="demo/UserDAORemote"/>
>       <property name="businessInterface" value="demo.UserDAORemote"/>
>       <property name="homeInterface" value="demo.UserDAORemoteHome"/>
>       <property name="refreshHomeOnConnectFailure" value="true"/>
>       <property name="cacheHome" value="true"/>
>       <property name="lookupHomeOnStartup" value="false"/>
>       <property name="resourceRef" value="true"/>
>       <property name="jndiTemplate" ref="jndiTemplate"/>
>    </bean>
> 
>    <cxfse:endpoint>
>       <cxfse:pojo>
>          <bean class="demo.LoginServiceImpl">
>             <property name="proxy" ref="ejbProxy"/>
>          </bean>
>       </cxfse:pojo>
>    </cxfse:endpoint>
> 
> </beans>