IBM RSA WTP Jax-rpc Create WS Client IWAB0639E WSWS3204E - java

I need help on an error I get when trying to create a web service client in IBM RSA using the WTP wizard.
The error says :
IWAB0639E Error in generating Java files and deployment descriptors from WSDL file
WSWS3204E: Error: {http:// [...] .com/ChannelSvcs/BranchMgmt/Schema/V1}OrganizationUnitCodeType already exists.
Couldn't find any hint to a solution on the net, only this one :
http://www-01.ibm.com/support/docview.wss?uid=swg1PK40815
But this page also says :
This updated WSDL2Java will be included in Rational Application Developer v6.0.1.2.
But our environment is : IBM RSA Version: 7.5.5.5 iFix001
Build ID: RSA4WSO7555iFix-I20121203_0630
As a local fix this site suggests :
Modify the existing wsdl structure so as not to include the same xsd file more than one time.
But at this point I don't prefer a local fix, unless there's no permanent fix.

Ok, I talked to the guy who published the web service and he told me to use the wsdl file in the documentation, not the wsdl file on the server (via URL).
so I did that and it worked.
Looks like the server sends all .xsd files and the .wsdl file mixing it into one response file.
Still, IMHO wsdl2java should still be able to process such files.

Related

What is the easiest/best solution for generating Java client code from WADL?

I'm trying to generate a Java client to talk to my Glassfish application server. This server provides a WADL at http://localhost:4848/management/application.wadl.
I would like to generate that Java client code during a maven build, so I naturally took the wadl-maven-plugin route. unfortunatly, regarding the application.wadl file, that plugin generates a 48 MB long Java source file, that seems to literally freeze Eclipse.
So, what are other good/efficient solutions to generate Java client out of WADL file ?

XSD file path in WSDL include is wrong

I'm more or less a beginner with web services but I've tried googling this with no results.
I have a web service written in Java using the Metro stack that runs fine when I run it on a local JBoss 5.1.0 instance but when I move it to our test server I start getting problems.
The service deploys correctly and I can view the WSDL as usual: https://myserver.myorg/path/service?wsdl
However, wsimport failed to generate client stubs from here and when I took a closer look at the WSDL I saw this:
<xsd:schema>
<xsd:import namespace="http://mynamespace/" schemaLocation="https://testserver.myorg:443/path/Service?null"/>
</xsd:schema>
Instead of what I would see when I ran it locally, which had the schemaLocation set to http://localhost:8080/path/Service?xsd=1
When I try putting in xsd=1 instead of null manually in a web browser, I get a 404 error.
Does anybody know what might cause this and how to fix it?
Thanks,
Raj.
I think the problem is that your XSD is behind an SSL connection, so your wsimport needs to know and trust the server SSL certificate.
For achieving this, you'll need to set up a new Java Keystore file (.jks file), or reuse an existing one if you already have it, add the server SSL certificate (for this, you can use the keytool provided with the JDK), and declare the Keystore a Trustore using the next JVM parameters on your wsimport invocation:
-Djavax.net.ssl.trustStore=${truststore.location} -Djavax.net.ssl.trustStorePassword=${ssl.password}
The test JBoss server is restarted weekly and following the restart, the XSD file is appearing properly. Sorry for the noise - I should learn to turn it off and on again before posting :).

Web service created with JAX-WS wsimport failing on AIX tomcat

I have a jar file which houses client code to connect to our infrastructure webservices that was initially created using axis' wsdl2java. I converted the guts of the connectivity this week to use the extract from wsimport. When running on my local Windows XP tomcat using java6_18 I have no issues and all runs perfectly. I have now moved my code to our development AIX instance and have lost total web service communication while receiving the following error:
XML reader error: javax.xml.stream.XMLStreamException:
The root element is required in a well-formed document
On AIX we are running java6_64.
I am assuming it is the AIX java libs not being compatible with the Sun provided java runtime libs however I am at a total loss at the moment as to how to resolve.
Can anybody shed some light on why I am receiving this exception?
This could be a code page issue as it complains that there is no root-element, and if the < character is misinterpreted as something else you have no root element.
Check the system properties to see what encoding the program runs under. You may have an assumption somewhere that the encoding is ISO-Latin-1 as under Windows.
I don't like answering my own question but thought recording the answer could be beneficial to others...
After digging a bit, the resolution was simply the format of the wsdl url. With axis, I specified the wsdl URL as the path to the webservice. For JAX-WS, it requires path to the service+"?wsdl" (the actual wsdl to load at runtime).
The above error was generated since the "axis" path did not result in the wsdl to pull but rather a blank resultset. Once I added the "?wsdl" all works fine.

Setting up axis2 soap server

I am trying to create a simple SOAP webservice (calculator) to learn the basics of this technology. I am new to SOAP so I have already done some things but I am not sure what to do next.
I have chosen a top-down approach, which means creating a wdsl file first and then generating the code automatically.
I have created a wsdl file with the service description and used that to generate java files. I have it both in 1.1 and 2.0 format. To get 2.0 files I used the wsdl2java tool of axis2, for 1.1 I used java wsimport tool.
From the wsimport tool I got the following files:
package-info.java
ObjectFactory.java
CalculatorService.java (name of my service)
Calculator.java (name of my portType)
Input.java (name of a complex type)
The wsdl2java tool gave me the following files:
services.xml
CalculatorService.wsdl
Output.java (name of output element)
Input.java (name of input element)
cInput.jaba (name of input complex element)
ExtensionMapper.java
CalculatorServiceCallbackHandler.java
CalculatorServiceMessageReceiverInOut.java
CalculatorServiceSkeleton.java (includes implementation of interface)
CalculatorServiceSkeletonInterface.java
CalculatorServiceStub.java
In the wsdl2java files I guess I have everything I need excpept the server implementation. As for the wsimport ones they are missing an implementation and I am not sure where to add it. The server implementation is also missing.
At first I would like to run it as a local service (local server) to test that it is working and also write a client later.
I found an example of a server implementation here: In-process SOAP service server for Java.
It seems quite simple and if possible I would like to use this approach. But I am not sure if it would work with the files I have generated (wsdl2java or wsimport). I also have an Apache server installed if it would be of use. So I am looking for advice, which set of files to use to set up the server and what would be the easiest way to do it.
Also I am wondering if the namespaces used in the wsdl file affect the service availability? Becuase they have to be URI-s but I do not have one for my service at the moment. So for targetNamespace, xmlns:tns, endpoint address, etc I used random URL-s. Would it work if I am trying to run it locally or would it create issues?
Ok, I think I found the solution myself.
Used Tomcat server and eclipse axis2 plugins to get the server and client working.
This was a good tutorial in my opinion: http://eclipse.dzone.com/articles/web-services-development-with-

How to cache a WSDL with Java-WS

I've created an app that interacts with a SOAP service using java WS. I generate classes and manage the WSDL using the built in netbeans functions.
Every time I run the application, it has to download the WSDL and parse it again. The WSDL is frozen at each version so I don't think this is necessary. I've tried to reference it as a local file, but then my app complains it can't find the file when it's installed on another machine.
Does anyone know how I can stop Java WS needing to re-parse the WSDL, or at least cache it locally?
I've figured it out...
This page has the info
Developing client application with locally packaged WSDL

Categories

Resources