cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jara Cesnek (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CXF-2665) "Remote procedure call" by couple JaxWsProxyFactoryBean and JaxWsServerFactoryBean doesnt work.
Date Tue, 09 Feb 2010 16:17:27 GMT

    [ https://issues.apache.org/jira/browse/CXF-2665?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12831519#action_12831519
] 

Jara Cesnek commented on CXF-2665:
----------------------------------

Removing serverFactoryBean.setServiceClass(...) not helping. 

(Are you sure that interface should be set to this method? 
I think there should be implementation class. 

serverFactoryBean.setServiceClass(WS *Impl*.class);
)


Anyway in WSDL is still *java package* of implementation! So client cant be aware of this
namespace. Client has of course only interface.

<xsd:schema attributeFormDefault="qualified" elementFormDefault="qualified" 
targetNamespace=" *http ://v1_1_2.rtf2pdf.pdf.doc.modules.daisy.marbes.cz/"*             
 //this namespace is NOT in interface annotation
xmlns:tns=" *http ://v1_1_2.rtf2pdf.pdf.doc.modules.daisy.marbes.cz/"*                   
          //this namespace is NOT in interface annotation
 xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:complexType name="ArrayOfString">
<xsd:sequence>
  <xsd:element maxOccurs="unbounded" minOccurs="0" name="string" nillable="true" type="xsd:string"
/> 
  </xsd:sequence>
  </xsd:complexType>
  </xsd:schema>


Strangest thing is that single method with List<String> broke all methods in interface.
When I remove single method with List<String> other methods start working.




> "Remote procedure call" by couple JaxWsProxyFactoryBean and JaxWsServerFactoryBean doesnt
work.
> -----------------------------------------------------------------------------------------------
>
>                 Key: CXF-2665
>                 URL: https://issues.apache.org/jira/browse/CXF-2665
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-WS Runtime
>    Affects Versions: 2.2.6
>            Reporter: Jara Cesnek
>            Priority: Critical
>
> Problem is that "remote procedure call" by couple JaxWsProxyFactoryBean and JaxWsServerFactoryBean
doesnt work.
> Methods from client (remote) interface return null values.
> Reason: server leaks namespace from service implementation (not only interface) .. so
client can read data and return null
> Server code:
> {code}
>         JaxWsServerFactoryBean serverFactoryBean = new JaxWsServerFactoryBean();
>         serverFactoryBean.setServiceClass(AopUtils.getTargetClass(implementor)); //WSImpl.class
>         serverFactoryBean.setServiceBean(implementor);                              
                   //WSImpl.class
>         serverFactoryBean.setDataBinding(new AegisDatabinding());
>         serverFactoryBean.setAddress(url);
>         serverFactoryBean.setBus(cxfServlet.getBus());
>         serverFactoryBean.create();
> {code}
> Client code:
> {code}
>             JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
>             factory.setServiceClass(resultInterfaceClass);                          
      //WS.class
>             factory.setAddress(asURL);
>             factory.setDataBinding(new AegisDatabinding());
>             Object remoteInterfaceImpl = factory.create();
> {code}
> Interface:
> {code}
> @WebService(name="datove_zdroje", targetNamespace="http://v1_0_0.ws.doc.daisy.marbes.cz")
> public interface WS {
>            List<String> getCodes(@WebParam(name = "baseCode") String baseCode);
> }
> {code}
> Implementation:
> {code}
> @WebService(serviceName = "datove_zdroje", endpointInterface = "cz.marbes.daisy.modules.doc.ws.v1_0_0.WS")
> public class WSImpl implements WS {
>     @Override
>     public List<String> getCodes(final String baseCode) {
>         return new ArrayList<String>();
>     }
> }
> {code}
> *In this configuration client always receive "NULL" from method call !*
> Problem is that server include in WSDL(and XML communication) namespace from service
implementation (WSImpl.java) - not only from (client) interface (WS.java).
> In this particular case servers "targetNamespace" is empty. So server made it up from
class and package name. But client has only information from interface.
> Client anticipate that "ServiceNamespace" is equals with "targetNamespace" from interface
(WS.java) WebService annotation.  
> *Working WSImpl.java:*
> {code}
> @WebService(serviceName = "datove_zdroje", endpointInterface = "cz.marbes.daisy.modules.doc.ws.v1_0_0.WS",

> *targetNamespace="http://v1_0_0.ws.doc.daisy.marbes.cz"* //must be same as WS.java targetNamespace
> )
> public class WSImpl implements WS {
> {code}
> *NON-Working WSImpl.java:*
> {code}
> @WebService(serviceName = "datove_zdroje", endpointInterface = "cz.marbes.daisy.modules.doc.ws.v1_0_0.WS",

> *targetNamespace=""* //empty or other than WS.java targetNamespace
> )
> public class WSImpl implements WS {
> {code}
> We need clarify real meaning of @WebService(targetNamespace="") on service implementation.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message