[JBossWS] - JSR-109Client, Mapping problem and trying to connect to a .N
by d_pavel
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
19 years
[JBossWS] - Re: Problem using wstools
by d_pavel
I should have posted these answers sooner then one month but time flies so here you go (in case somebody will stumble upon same things):
-I solved relatively fast the wstools problem which turned out to be the result of using the full path for the SEI class in the command which I described in point 4 in my first post (as was mentioned in the user guide...). So using a path just to WEB-INF/classes directory solved the problem and the related artifacts are generated correct.
-jbossws14-client.jar is needed for J2EE 1.4, whereas jbossws-client.jar is needed for Java EE; if you keep both jar files order of loading is important depending what you need to use.
-yes I had to get an updated "jboss-xml-binding.jar
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4036182#4036182
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4036182
19 years
[JBoss Seam] - Re: Request for PDF p:element tag
by supernovasoftware.com
I am doing the following in order to add a vector logo to my PDF documents. I had my graphics artist make the logo in vector and then save it as a PDF. I then read this PDF fragment from the classpath and then use iText to write it to an empty region of a PDF that I created using JasperReports. I wanted t do it this way so that the logo would not be distored regardless of the size or zoom of the PDF. There is a code sample below. Is this possible using Seam PDF?
| InputStream in = getClass().getClassLoader().getResourceAsStream("pipetracker/model/state/type/pipetracker_paperwork_logo.pdf");
| PdfReader pdfReaderLogo = new PdfReader(in);
| Rectangle psizeLogo = pdfReaderLogo.getPageSize(1);
|
| // step 1: creation of a document-object
| Document document = new Document(psize);
| // // step 2: we create a writer that listens to the document
| PdfWriter writer = PdfWriter.getInstance(document, baos2);
| document.open();
| PdfContentByte cb = writer.getDirectContent();
|
| PdfImportedPage pageReport = writer.getImportedPage(pdfReader, 1);
| PdfImportedPage pageLogo = writer.getImportedPage(pdfReaderLogo, 1);
|
| cb.addTemplate(pageReport, 0, 0);
| cb.addTemplate(pageLogo, .4f, 0f, 0f, .4f, 20, 610);
|
| document.close();
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4036181#4036181
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4036181
19 years