Amila,
I could recreate the problem I had with ADB on AXIS2-1.2-RC2:
When running a little I end up with the following exception:
java.lang.RuntimeException: java.lang.StringIndexOutOfBoundsException:
String index out of range: -1
at
org.plcs.www.plmservices.QueryManagementStub.fromOM(QueryManagementStub.java:1692)
...
Caused by: java.lang.StringIndexOutOfBoundsException: String index out
of range: -1
at java.lang.String.substring(String.java:1768)
at
org.plcs.www.plmservices.types.PLM_object$Factory.parse(PLM_object.java:378)
which appears in the generated code here:
public static PLM_object
parse(javax.xml.stream.XMLStreamReader reader) throws
java.lang.Exception{
PLM_object object = new PLM_object();
int event;
java.lang.String nillableValue = null;
java.lang.String prefix ="";
java.lang.String namespaceuri ="";
try {
while (!reader.isStartElement() &&
!reader.isEndElement())
reader.next();
if
(reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){
java.lang.String fullTypeName =
reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance",
"type");
if (fullTypeName!=null){
Ln378---> Exception HERE! java.lang.String
nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":"));
nsPrefix = nsPrefix==null?"":nsPrefix;
java.lang.String type =
fullTypeName.substring(fullTypeName.indexOf(":")+1);
if (!"PLM_object".equals(type)){
//find namespace for the prefix
java.lang.String nsUri =
reader.getNamespaceContext().getNamespaceURI(nsPrefix);
return
(PLM_object)org.plcs.www.system.ExtensionMapper.getTypeObject(
nsUri,type,reader);
}
}
Cheers,
Patrick.
Patrick Houbaux wrote:
I'm using AXIS2-1.2-RC2.
I did merge the WSDL as you suggested and everything works now as
expected. The performance problem was problably due to the fact that I
was obliged to generate the resources in separate resources folder for
each WSDL. The classloader might be for something in this as a bunch of
things are common to those resources.
If I remember correctly there was something wrong with inhenritance
when using ADB (The data type is really a complex one). I can try to
recreate the problem with ADB and open a JIRA issue when I got it.
Cheers,
Patrick.
Amila Suriarachchi wrote:
On 4/18/07, Patrick Houbaux <[EMAIL PROTECTED]>
wrote:
Hello Amila,
I did try with other databinding framework, I actually started with ADB
but the type schema is a bit too complex for it so I changed to
xmlbeans which generate the java type data model correctly.
What is the axis2 version you use? if you use Axis2 1.1.1 please try
with RC2. and if possible please create a jira with your wsdl.
I haven't
succeeded to make JiBX working (lack of experience from my side I guess
and the documentation is not really explicit on this).
I actually did more investigations and noticed that if I separate all
the resources (the binary) generated from each WSDL (using the -R
option) while all the sources are in the same output folder it works.
The only problem now is a performance problem which I don't know if
it's an AXIS2 problem or a server side problem yet (the server is .NET
based). I suspect an AXIS2 problem as .NET client do not have any
performance issues.
yes. generally xmlbeans and jaxb is slower than the adb and jibx.
When you suggest to merge the wsdl files in one, do you
mean that AXIS2
(xmbeans generation) supports several <service>
...</service> in the wsdl?
yes. but it will be there with the Axis2 1.2 which will release soon.
Cheers,
Patrick.
Amila Suriarachchi wrote:
you also have the same problem as in
http://issues.apache.org/jira/browse/AXIS2-2075
the only option i can see is to merge the two wsdl files and generate
the code once.
Can you try out another databinding frame work?
On 4/17/07, Patrick Houbaux <[EMAIL PROTECTED]
> wrote:
Hello,
I'm writing a client against several WSDL which are all sharing the
same schemas for types.
Let's say I have the following:
- WSDL1 using schema typeA and schema typeB
- WSDL2 using schema typeA and schema typeC
When I generate the client stub with AXIS2 (using xmlbeans bindings)
against WSDL1 and implement a small client using only this stub
everything works great.
When I start to generate the client stub with AXIS2 (using xmlbeans
binding) against WSDL2 in the same output folders where client stub for
WSDL1 was and run my small client without touching any lines I get
some ClassCastException on the java type generated with AXIS2
(sources/resources were regenerated and overwritten against WSDL2).
I did repack the resources generated folder and added it to my project
classpath everytime I generated a new stub.
If anybody can advise on how to generate client stubs against several
WSDL sharing the same schema types, it would be really useful.
Thanks for any help.
I'm using AXIS2-1.2-RC2, and here are my settings for generating the
stubs:
<target name="generate.client.sm">
<java classname="org.apache.axis2.wsdl.WSDL2Java"
fork="true" maxmemory="128m">
<classpath refid="axis2.classpath"/>
<jvmarg value="-Xss2048k"/>
<arg value="-d"/>
<arg value="xmlbeans"/>
<arg value="-uri"/>
<arg value="${wsdl.sm.url}"/>
<arg value="-g"/>
<arg value="-ssi"/>
<arg value="-s"/>
<arg value="-u">
<arg value="-o"/>
<arg file="${src.client}"/>
</java>
</target>
<target name="generate.client.cm">
<java classname="org.apache.axis2.wsdl.WSDL2Java"
fork="true" maxmemory="128m">
<classpath refid="axis2.classpath"/>
<jvmarg value="-Xss2048k"/>
<arg value="-d"/>
<arg value="xmlbeans"/>
<arg value="-uri"/>
<arg value="${wsdl.cm.url}"/>
<arg value="-g"/>
<arg value="-ssi"/>
<arg value="-s"/>
<arg value="-u"/>
<arg value="-o"/>
<arg file="${src.client}"/>
</java>
</target>
I was wondering if using the option -uw would help in anyway.
Cheers,
Patrick.
This message contains information that may be
privileged or
confidential and is the property of Eurostep Group. It is intended only
for the person to whom it is addressed. If you are not the intended
recipient, you are not authorized to read, print, retain, copy,
disseminate, distribute, or use this message or any part thereof. If
you receive this message in error, please notify the sender immediately
and delete all copies of this message.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Amila Suriarachchi,
WSO2 Inc.
This message contains information that may be privileged or
confidential and is the property of Eurostep Group. It is intended only
for the person to whom it is addressed. If you are not the intended
recipient, you are not authorized to read, print, retain, copy,
disseminate, distribute, or use this message or any part thereof. If
you receive this message in error, please notify the sender immediately
and delete all copies of this message.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Amila Suriarachchi,
WSO2 Inc.
This message contains information that may be privileged or
confidential and is the property of Eurostep Group. It is intended only
for the person to whom it is addressed. If you are not the intended
recipient, you are not authorized to read, print, retain, copy,
disseminate, distribute, or use this message or any part thereof. If
you receive this message in error, please notify the sender immediately
and delete all copies of this message.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
|