[jboss-user] [JBossWS] - JSR-109Client, Mapping problem and trying to connect to a .N

d_pavel do-not-reply at jboss.com
Tue Apr 10 22:24:09 EDT 2007


Hi All,

I developed a JAX-RPC web service client in order to connect to a .NET webservice. I am using jdk1.5.0_09, JBoss AS 4.0.5.GA and jbossws-1.2.0.GA. I set properly the java.endorsed.dirs.
Here is the config file:

  | <?xml version="1.0" encoding="UTF-8"?>
  | 
  | <!-- top~down or wsdl~to~java JAX-RPC config file -->
  | <configuration xmlns="http://www.jboss.org/jbossws-tools"
  | 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  | 	xsi:schemaLocation="http://www.jboss.org/jbossws-tools http://www.jboss.org/jbossws-tools/schema/jbossws-tool_1_0.xsd">
  | 
  | 	<wsdl-java file="META-INF/Vax.wsdl">
  | 		<mapping file="jaxrpc-mapping.xml" />
  | 	</wsdl-java>
  | 	
  | </configuration>
  | 
Using wstools I was able to generate the related artifacts (the jaxrpc-mapping.xml file and all the related stubs and the required Service Endpoint Interface (SEI). 

The target namespace it will be similar with: "https://www.acompany.com/VaxHttp/Vax" 

The important code in my client looks like this:

  |         String feedback = "";
  |         try
  |         {               
  |             URL url = null;
  |             //wsdl location                    
  |             try 
  |             {
  |                 url = new URL(urlstr);
  |             } 
  |             catch (MalformedURLException e) 
  |             {
  |                 e.printStackTrace();
  |             }
  | 
  |             QName qName = new QName("https://www.acompany.com/VaxHttp/Vax.asmx?wsdl", "Vax");      
  |              
  |             System.out.println("############   local part = "+qName.getLocalPart());
  |             System.out.println("############   namespace URI = "+qName.getNamespaceURI());
  |             
  |             //set jboss ServiceFactory
  |             System.setProperty( "javax.xml.rpc.ServiceFactory",
  |                 "org.jboss.ws.core.jaxrpc.client.ServiceFactoryImpl" );
  |  
  |             //have to have only one instance of the ServiceFactory
  |             ServiceFactoryImpl serviceFactory = (ServiceFactoryImpl)ServiceFactory.newInstance();
  |             File mapping = new File("WebRoot/WEB-INF/jaxrpc-mapping.xml");
  |             URL mappingURL = null;
  |             try
  |             {
  |                 mappingURL = mapping.toURL();
  |             } 
  |             catch (MalformedURLException e) 
  |             {
  |                 e.printStackTrace();
  |             }
  | 
  |             ServiceImpl service = (ServiceImpl)serviceFactory.createService(url, qName, mappingURL);        
  |     
  |             //get stub or dynamic proxy that supports the specified service endpoint interface     
  |             VaxSoap   port   = (VaxSoap) service.getPort(VaxSoap.class);
  | 
  |             //create PutOrder object 
  |             PutOrder   po = new PutOrder(...);
  |             
  |             //using SOAP 1.1 and calling the related method on the service endpoint interface
  |             PutOrderResponse status = port.putOrder(po);
  |             
  |             feedback = status.getPutOrderResult();
  |             //check the PurchaseOrder status
  |             System.out.println("output order response:" + feedback);
  |  
  |         }
  |         catch(ServiceException se)
  |         {
  |             System.out.println("Service Exception from executePutPurchaseOrder() = "+se.getMessage());
  |         }
  |         
  |         return feedback;
  | 

Now when I try to run the client passing the valid parameters, I get the following mapping exception from the Client:
anonymous wrote : 
  | Could not update IN parameter to be INOUT, as indicated in the mapping: parameters
  | 
In the generated jaxrpc-mapping.xml (after the wsdl available) all the ~SoapIn wsdl-message from within the related wsdl-message-mapping have this
anonymous wrote : 
  | <parameter-mode>INOUT</parameter-mode>
  | 
parameter mode defined. 
I want to metion that is no denial of traffic and the network is good.
Now this param can be IN, OUT, or INOUT. I should not have to modify this generated xml file! However if I modify it and put "IN" instead of "INOUT" I am able to go further (but this in fact is not correct because the called method has to return a PutOrderResponse object so we need the INOUT isn't it ?). Anyway using a modified jaxrpc-mapping.xml as I said before I am able to make the invokation to the remote web service but it barfs here:
anonymous wrote : 
  | org.jboss.remoting.CannotConnectException: Can not connect http client invoker.
  | 
This exception is generated when the remoting layer cannot connect to
the remote server . It means that the client cannot send the request to
the server. Well it's normal I think when the remote side is on .NET and  the JBoss TransporterClient(InvokerLocator locator, String targetSubsystem) it's trying to use a org.jboss.remoting.InvokerLocator which will work as it is only between JBOSS application servers (correct me if I'm wrong please). The JBossWS fails to create properly the org.jboss.remoting.Client remoteClient instance.
How can one explicitly set the transport protocol to be "http" (and not "socket" as for the JBoss AS) ?
I mean the InvokerLocator has to take that into consideration when trying to connect to .NET webservices right ?
There is some documentation or useful links related to how to connect to  .NET webservices ? I will have also my own JBoss webservices which will have to be accessible from any endpoint (well .NET is the one I'm afraid off and it's causing me grief). 

Did I missed something ? I mean the client description is pretty straight forward in the user guide...

Aside: when the "JBoss Remoting" comes in to play ? For what is recommended especially ?If one doesn't use transports and data marshallers or push and pull callbacks, then doesn't need "JBoss Remoting" either right?

I hope to get an answer to this post because this is not trivial to debug and fix. Please help.
I would really appreciate an/any answer as soon as possible.

Thank you in advance.

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

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



More information about the jboss-user mailing list