You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by liucong <li...@gmail.com> on 2009/07/04 13:51:40 UTC

An Exception occurs when use wsdl extension in the port

Hi all,
When I implement the WSDL usage for SOAP/JMS, I encountered an exception.
I create an service and invoke it using wsdl-first.

If the wsdl file looks like this[1] :
<wsdl:definitions>
<wsdl:service name="JMSGreeterService">
<wsdl:port binding="tns:JMSGreeterPortBinding" name="GreeterPort">
<soap:address
location="jms:jndi:dynamicQueues/test.cxf.jmstransport.queue?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61616&amp;targetService=greeterService"
/>
<soapjms:timeToLive>1000</soapjms:timeToLive>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

This service works well.

But if the wsdl file looks like this[2] :
<wsdl:definitions>
<wsdl:service name="JMSGreeterService">
<wsdl:port binding="tns:JMSGreeterPortBinding" name="GreeterPort">
<soapjms:timeToLive>1000</soapjms:timeToLive>
<soap:address
location="jms:jndi:dynamicQueues/test.cxf.jmstransport.queue?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61616&amp;targetService=greeterService"
/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

The service is created correctly, but there is an error happen when I
invoke this service.
By debugging, I find that JMSTransportFactory.getConduit(EndpointInfo
endpointInfo, EndpointReferenceType target)'s target parameter is null.
It should be
"jms:jndi:dynamicQueues/test.cxf.jmstransport.queue?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61616&amp;targetService=greeterService".

I think there are someting wrong with port parsing in wsdl.
Any ideas?

best regards
liu

Re: An Exception occurs when use wsdl extension in the port

Posted by liucong <li...@gmail.com>.
Hi Dan,

Thank you for your good advice. I think keeping the "soap" stuff in the
soap binding is a very good idea.
https://issues.apache.org/jira/browse/CXF-2264?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12727756#action_12727756
<https://issues.apache.org/jira/browse/CXF-2264?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12727756#action_12727756>

liu

Daniel Kulp wrote:
> A test case (attached to a JIRA) would be good if you cannot figure this out.
>
> However, here is a pointer:
> When CXF looks in the WSDL to determine the transport factory, it looks at the 
> FIRST extensor on the port that has a namespace that matches a transport 
> factory.  In your first example, it would be "soap" and thus would match the 
> "soap" transport.
>
> In the second, it would be "soapjms" and thus probably matches the JMS 
> transport and not the soap transport.   The jms transport probably doesn't 
> look for "soap:address".
>
> Not sure on the best course of action to solve this.   :-(     Possibly the 
> soap binding could reset the address on the transport or something.   Would be 
> good to check if this is the case before diving in too deep.  
>
> Dan
>
>
>
>
>
> On Sat July 4 2009 7:51:40 am liucong wrote:
>   
>> Hi all,
>> When I implement the WSDL usage for SOAP/JMS, I encountered an exception.
>> I create an service and invoke it using wsdl-first.
>>
>> If the wsdl file looks like this[1] :
>> <wsdl:definitions>
>> <wsdl:service name="JMSGreeterService">
>> <wsdl:port binding="tns:JMSGreeterPortBinding" name="GreeterPort">
>> <soap:address
>> location="jms:jndi:dynamicQueues/test.cxf.jmstransport.queue?jndiInitialCon
>> textFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiC
>> onnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61616&amp
>> ;targetService=greeterService" />
>> <soapjms:timeToLive>1000</soapjms:timeToLive>
>> </wsdl:port>
>> </wsdl:service>
>> </wsdl:definitions>
>>
>> This service works well.
>>
>> But if the wsdl file looks like this[2] :
>> <wsdl:definitions>
>> <wsdl:service name="JMSGreeterService">
>> <wsdl:port binding="tns:JMSGreeterPortBinding" name="GreeterPort">
>> <soapjms:timeToLive>1000</soapjms:timeToLive>
>> <soap:address
>> location="jms:jndi:dynamicQueues/test.cxf.jmstransport.queue?jndiInitialCon
>> textFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiC
>> onnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61616&amp
>> ;targetService=greeterService" />
>> </wsdl:port>
>> </wsdl:service>
>> </wsdl:definitions>
>>
>> The service is created correctly, but there is an error happen when I
>> invoke this service.
>> By debugging, I find that JMSTransportFactory.getConduit(EndpointInfo
>> endpointInfo, EndpointReferenceType target)'s target parameter is null.
>> It should be
>> "jms:jndi:dynamicQueues/test.cxf.jmstransport.queue?jndiInitialContextFacto
>> ry=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnection
>> FactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61616&amp;targetSe
>> rvice=greeterService".
>>
>> I think there are someting wrong with port parsing in wsdl.
>> Any ideas?
>>
>> best regards
>> liu
>>     
>
>   


Re: An Exception occurs when use wsdl extension in the port

Posted by liucong <li...@gmail.com>.
Thank you, Dan.

I just found the problem as you said.
I can make the JMSTransportFactory implement WSDLEndpointFactory
interface. And then the SOAPAddress can be used to create
createEndpointInfo. Then the problem will be solved. I'm trying to do this.

liu

Daniel Kulp wrote:
> A test case (attached to a JIRA) would be good if you cannot figure this out.
>
> However, here is a pointer:
> When CXF looks in the WSDL to determine the transport factory, it looks at the 
> FIRST extensor on the port that has a namespace that matches a transport 
> factory.  In your first example, it would be "soap" and thus would match the 
> "soap" transport.
>
> In the second, it would be "soapjms" and thus probably matches the JMS 
> transport and not the soap transport.   The jms transport probably doesn't 
> look for "soap:address".
>
> Not sure on the best course of action to solve this.   :-(     Possibly the 
> soap binding could reset the address on the transport or something.   Would be 
> good to check if this is the case before diving in too deep.  
>
> Dan
>
>
>
>
>
> On Sat July 4 2009 7:51:40 am liucong wrote:
>   
>> Hi all,
>> When I implement the WSDL usage for SOAP/JMS, I encountered an exception.
>> I create an service and invoke it using wsdl-first.
>>
>> If the wsdl file looks like this[1] :
>> <wsdl:definitions>
>> <wsdl:service name="JMSGreeterService">
>> <wsdl:port binding="tns:JMSGreeterPortBinding" name="GreeterPort">
>> <soap:address
>> location="jms:jndi:dynamicQueues/test.cxf.jmstransport.queue?jndiInitialCon
>> textFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiC
>> onnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61616&amp
>> ;targetService=greeterService" />
>> <soapjms:timeToLive>1000</soapjms:timeToLive>
>> </wsdl:port>
>> </wsdl:service>
>> </wsdl:definitions>
>>
>> This service works well.
>>
>> But if the wsdl file looks like this[2] :
>> <wsdl:definitions>
>> <wsdl:service name="JMSGreeterService">
>> <wsdl:port binding="tns:JMSGreeterPortBinding" name="GreeterPort">
>> <soapjms:timeToLive>1000</soapjms:timeToLive>
>> <soap:address
>> location="jms:jndi:dynamicQueues/test.cxf.jmstransport.queue?jndiInitialCon
>> textFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiC
>> onnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61616&amp
>> ;targetService=greeterService" />
>> </wsdl:port>
>> </wsdl:service>
>> </wsdl:definitions>
>>
>> The service is created correctly, but there is an error happen when I
>> invoke this service.
>> By debugging, I find that JMSTransportFactory.getConduit(EndpointInfo
>> endpointInfo, EndpointReferenceType target)'s target parameter is null.
>> It should be
>> "jms:jndi:dynamicQueues/test.cxf.jmstransport.queue?jndiInitialContextFacto
>> ry=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnection
>> FactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61616&amp;targetSe
>> rvice=greeterService".
>>
>> I think there are someting wrong with port parsing in wsdl.
>> Any ideas?
>>
>> best regards
>> liu
>>     
>
>   


Re: An Exception occurs when use wsdl extension in the port

Posted by Daniel Kulp <dk...@apache.org>.
A test case (attached to a JIRA) would be good if you cannot figure this out.

However, here is a pointer:
When CXF looks in the WSDL to determine the transport factory, it looks at the 
FIRST extensor on the port that has a namespace that matches a transport 
factory.  In your first example, it would be "soap" and thus would match the 
"soap" transport.

In the second, it would be "soapjms" and thus probably matches the JMS 
transport and not the soap transport.   The jms transport probably doesn't 
look for "soap:address".

Not sure on the best course of action to solve this.   :-(     Possibly the 
soap binding could reset the address on the transport or something.   Would be 
good to check if this is the case before diving in too deep.  

Dan





On Sat July 4 2009 7:51:40 am liucong wrote:
> Hi all,
> When I implement the WSDL usage for SOAP/JMS, I encountered an exception.
> I create an service and invoke it using wsdl-first.
>
> If the wsdl file looks like this[1] :
> <wsdl:definitions>
> <wsdl:service name="JMSGreeterService">
> <wsdl:port binding="tns:JMSGreeterPortBinding" name="GreeterPort">
> <soap:address
> location="jms:jndi:dynamicQueues/test.cxf.jmstransport.queue?jndiInitialCon
>textFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiC
>onnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61616&amp
>;targetService=greeterService" />
> <soapjms:timeToLive>1000</soapjms:timeToLive>
> </wsdl:port>
> </wsdl:service>
> </wsdl:definitions>
>
> This service works well.
>
> But if the wsdl file looks like this[2] :
> <wsdl:definitions>
> <wsdl:service name="JMSGreeterService">
> <wsdl:port binding="tns:JMSGreeterPortBinding" name="GreeterPort">
> <soapjms:timeToLive>1000</soapjms:timeToLive>
> <soap:address
> location="jms:jndi:dynamicQueues/test.cxf.jmstransport.queue?jndiInitialCon
>textFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiC
>onnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61616&amp
>;targetService=greeterService" />
> </wsdl:port>
> </wsdl:service>
> </wsdl:definitions>
>
> The service is created correctly, but there is an error happen when I
> invoke this service.
> By debugging, I find that JMSTransportFactory.getConduit(EndpointInfo
> endpointInfo, EndpointReferenceType target)'s target parameter is null.
> It should be
> "jms:jndi:dynamicQueues/test.cxf.jmstransport.queue?jndiInitialContextFacto
>ry=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnection
>FactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61616&amp;targetSe
>rvice=greeterService".
>
> I think there are someting wrong with port parsing in wsdl.
> Any ideas?
>
> best regards
> liu

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

Re: An Exception occurs when use wsdl extension in the port

Posted by Willem Jiang <wi...@gmail.com>.
Hi,

Can you submit a test case for it ?
BTW, is there anything wrong with creating the server from this WSDL ?

Willem

liucong wrote:
> Hi all,
> When I implement the WSDL usage for SOAP/JMS, I encountered an exception.
> I create an service and invoke it using wsdl-first.
> 
> If the wsdl file looks like this[1] :
> <wsdl:definitions>
> <wsdl:service name="JMSGreeterService">
> <wsdl:port binding="tns:JMSGreeterPortBinding" name="GreeterPort">
> <soap:address
> location="jms:jndi:dynamicQueues/test.cxf.jmstransport.queue?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61616&amp;targetService=greeterService"
> />
> <soapjms:timeToLive>1000</soapjms:timeToLive>
> </wsdl:port>
> </wsdl:service>
> </wsdl:definitions>
> 
> This service works well.
> 
> But if the wsdl file looks like this[2] :
> <wsdl:definitions>
> <wsdl:service name="JMSGreeterService">
> <wsdl:port binding="tns:JMSGreeterPortBinding" name="GreeterPort">
> <soapjms:timeToLive>1000</soapjms:timeToLive>
> <soap:address
> location="jms:jndi:dynamicQueues/test.cxf.jmstransport.queue?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61616&amp;targetService=greeterService"
> />
> </wsdl:port>
> </wsdl:service>
> </wsdl:definitions>
> 
> The service is created correctly, but there is an error happen when I
> invoke this service.
> By debugging, I find that JMSTransportFactory.getConduit(EndpointInfo
> endpointInfo, EndpointReferenceType target)'s target parameter is null.
> It should be
> "jms:jndi:dynamicQueues/test.cxf.jmstransport.queue?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61616&amp;targetService=greeterService".
> 
> I think there are someting wrong with port parsing in wsdl.
> Any ideas?
> 
> best regards
> liu
>