Thanks for the reply.

Regarding the multiple declarations of the package/namespace mapping in the 
jaxrpc mapping file, I don't know why that is happening.  My only guess is that 
it comes from the fact that the service endpoint has three methods.  I'm only 
dealing with one right now, but there is code for three.  I'm generating the 
mapping file using wscompile from this config:

<?xml version="1.0" encoding="UTF-8"?>
  | <configuration xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/config";>
  |   <service name="tws"
  |     targetNamespace="http://tws.mycompany.com";
  |     typeNamespace="http://tws.mycompany.com/types";
  |     packageName="com.mycompany.tws"
  |   >
  |     <interface name="com.mycompany.tws.AuthenticationJse"/>
  |     <namespaceMappingRegistry>
  |       <namespaceMapping
  |         namespace="http://security.enterprise.mycompany.com";
  |         packageName="com.mycompany.enterprise.security"
  |       />
  |       <namespaceMapping
  |         namespace="http://security.tws.mycompany.com";
  |         packageName="com.mycompany.tws.security"
  |       />
  |     </namespaceMappingRegistry>             
  |   </service>
  | </configuration>
  | 

Regarding client-side artifacts, I am using dynamic proxy, so besides 
recompiling my client and redeploying the service, I didn't do anything.

Here's how I'm calling the service:

private static final String AUTH_WSDL_URL = 
"http://localhost:8080/tms/security/authentication?WSDL";;
  | private static final String TWS_NS = "http://tws.mycompany.com";;
  | private static final String TWS_SECURITY_NS = 
"http://security.tws.mycompany.com";;
  | private static final QName TWS_SERVICE_QNAME = new QName(TWS_NS, "Tws");
  | private static final QName AUTH_JSE_PORT_QNAME = new QName(TWS_NS, 
"AuthenticationJsePort");   
  | 
  | public TmsServicesImpl() throws ServiceUnavailableException {
  |     Service authService = getService(AUTH_WSDL_URL, TWS_SERVICE_QNAME);
  |     if (authService != null) {
  |         TypeMappingRegistry reg = authService.getTypeMappingRegistry(); 
  |         TypeMapping mapping = reg.getDefaultTypeMapping();
  |         registerType(mapping, TWS_SECURITY_NS,  "AuthenticationTokenBean",  
  |             AuthenticationTokenBean.class);
  |         m_authenticationService = (AuthenticationJse) 
  |             getServicePort(authService, AUTH_JSE_PORT_QNAME, 
  |             AuthenticationJse.class);
  |     }
  | }
  |     
  | /**
  |  * Handles the common mechanics and exception handling involved with 
fetching 
  |  * a TWS service endpoint.
  |  * @param wsdlUrl the URL of the WSDL for the service endpoint.
  |  * @param srvcName the qualifed name of the service endpoint.
  |  * @return a remote reference to the service.
  |  */
  | private Service getService(String wsdlUrl, QName srvcName) 
  | throws ServiceUnavailableException {
  |     Service srvc = null;
  |     try {
  |         srvc = javax.xml.rpc.ServiceFactory.newInstance().createService(
  |             new URL(wsdlUrl), srvcName); 
  |     } catch (MalformedURLException mue) {
  |         mue.printStackTrace();
  |         return null;
  |     } catch (ServiceException se) {
  |         throw new ServiceUnavailableException(
  |                 "Service " + srvcName.toString() + " is unavailable.", se);
  |     }
  |     return srvc;
  | }
  | 
  | /** 
  |  * Handles the common mechanics and exception handling involved with 
fetching 
  |  * a TWS service port.
  |  * @param service the service
  |  * @param qn the qualified name of the service port
  |  * @param jse the class of the JSE interface to be fetched
  |  * @return a remote reference to the service port.
  |  */
  | private Remote getServicePort(Service service, QName qn, Class jse) {
  |     try {
  |         return service.getPort(qn, jse);
  |     } catch (ServiceException se) {
  |         se.printStackTrace();
  |         return null;
  |     }
  | }
  | 
  | private void registerType(TypeMapping mapping, String nameSpace, 
  |     String localName, Class type) {
  |     QName qn = new QName(nameSpace, localName);
  |     mapping.register (
  |         type,
  |         qn,
  |         new BeanSerializerFactory(type, qn),
  |         new BeanDeserializerFactory(type, qn)
  |     );
  | }

Should I be doing something different?  I don't like that I have to register 
the serializers for the return type manually.  I know there is a JBoss-specific 
ServiceFactory implementation that takes the jaxrpc mapping as an argument to 
avoid this problem, but I don't want to use the JBoss-specific service factory 
because since this client will need to work for a service deployed on BEA, 
also.  



View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3907095#3907095

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3907095


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to