Rob Wednesday

Greenhorn
+ Follow
since Feb 02, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Rob Wednesday

Ivan,

Thanks for the encouragement. I decided to try the custom code route to get around generated code problem. It is still a work in progress.

Naren,

> 1. One thing I didn't understand is "schema1" occurrence in your stack trace. I don't see this in your simple.wsdl. How is it referring to this?
I don't know either. The original WSDL was saved from the .NET 2.0 server.

> 2. I see the schema declaration is not conforming to namepace. ref attribute should point to valid element instance which is already defined.
Yes. I don't know what is actually being sent back yet, due to other issues in my test.

I will post how this works out.

Thanks for your help,
Rob.
13 years ago

Thanks for your reply.

I am attempting to pull data from an external web service, so upgrading to a later version of .Net is not possible.

Is there a Java alternative to the JDK based web services that is known to work with .Net 2.0? I started experimenting with Axis2, but it gave me an exception running wsdl2java.bat.

Also, I keep thinking there is some modification to the wsdl above that could make it work. I don't understand the "ref" construct. I guess it means any type in the schema. There should be a way to replace the any types on return with the explicit types to expect.

<s:complexType>
<s:sequence>
<s:element ref="s:schema"/> <!-- compile succeeds without this line -->
<s:any/>
</s:sequence>
</s:complexType>

Still experimenting, any help is appreciated!

Rob.
13 years ago
I am having difficulty compiling a .NET 2.0 generated wsdl file with 1.6.0_22 wsimport. The project goal is to create
a client for an existing external web service. The provided wsdl file can be successfully imported with .Net or SOAPUI.
I am trying to figure out a modification that would allow compilation with wsimport. I reduced the original wsdl down
to the essential parts to help debug it. I have tried several solutions, but none work. None of my searches have
provided an answer.

wsimport error:

[WARNING] src-resolve.4.2: Error resolving component 's:schema'. It was detected that 's:schema' is in namespace
'http://www.w3.org/2001/XMLSchema', but components from this namespace are not referenceable from schema document
'<path>/simple.wsdl#types?schema1'. If this is the incorrect namespace, perhaps the prefix of 's:schema' needs to
be changed. If this is the correct namespace, then an appropriate 'import' tag should be added to
'<path>/simple.wsdl#types?schema1'. line 13 of <path>/ADM/simple.wsdl#types?schema1

[ERROR] undefined element declaration 's:schema'
line 13 of <path>/simple.wsdl


simple.wsdl:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://www.somewhere.net/"
targetNamespace="http://www.somewhere.net/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">

<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="http://www.somewhere.net/">
<s:element name="HelloWorld">
<s:complexType>
<s:sequence>
<s:element ref="s:schema"/> <!-- compile succeeds without this line -->
<s:any/>
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
</wsdl:types>

<wsdl:message name="HelloWorldSoapIn">
<wsdl:part name="parameters" element="tns:HelloWorld"/>
</wsdl:message>

<wsdl:portType name="soap">
<wsdl:operation name="HelloWorld"> <wsdl:input message="tns:HelloWorldSoapIn"/> </wsdl:operation>
</wsdl:portType>

<wsdl:binding name="soap" type="tns:soap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="HelloWorld">
<soap:operation soapAction="http://www.somewhere.net/HelloWorld" style="document"/>
<wsdl:input> <soap:body use="literal"/> </wsdl:input>
<wsdl:output> <soap:body use="literal"/> </wsdl:output>
</wsdl:operation>
</wsdl:binding>

<wsdl:service name="data">
<wsdl:port name="soap" binding="tns:soap">
<soap:address location="http://somewhere.net/data.asmx"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>


Thanks,
Rob.
13 years ago
Thanks for your help.

I got off track in an initial test because o.xyz worked. I forgot that it was accessible because of package permissions.

Rob.
17 years ago
Am I missing something?

The concept of automagic properties is nice, but not that useful because generated methods have same permission as fields. The point of a bean/properties is to provide encapsulation. Private fields do not generate access methods. Public fields should typically be avoided.

Doc at: http://docs.codehaus.org/display/GROOVY/Groovy+Beans


class One {
private int xyz
int abc
}

class Two {
private int xyz

int getXyz() {return xyz} // not created automatically for private
void setXyz(int x) {xyz=x} // not created automatically for private
}

def o=new One()
//o.setXyz(1111)// causes exception
o.setAbc(123)// works

def t=new Two()
t.setXyz(222)


Rob.
17 years ago
I am confused about the performance and deployment issues of using Groovy.

My understanding is that Groovy is always compiled to bytecode.
In addition, it can be pre-compiled into a class/jar file.

Do any language features require dynamic compilation?
In other words, is it possible to always pre-compile an application.

Is only the JRE required? Or is the JDK needed for some features?

Rob.
17 years ago
Thanks. I know there are other ways to do it. Being new to ant, I was just curious about using a string substitution solution.
19 years ago
The list of java files is a selected subset of files in a directory. I am able to use the list as input to a javac task. As an example, I would then like to add the generated class files to a jar file. The idea is to supply one list of files to be processed. I'm new to ant and thought there would be an easy way to do the string substitution.

Thanks, Rob.
19 years ago
Thanks for your reply. The article was helpful.

Rob.
19 years ago
Hello,

Is it possible to test whether a class file or jar file is compatible with a particular java version? It would be nice to know if any incompatibilities exist without having to rebuild a jar file.

Thanks, Rob.
19 years ago
Hello,

Given a list of files in a property, how can I change the file extension? Is it possible to do general string substitutions with ANT? I tried using the mapper task, but that seems to be limited to a few tasks. Ideally, I would like to create another property based on a mapping of an input property. For example: javaFiles=file1.java,file2.java converts to classFiles=file1.class,file2.class.

I know this can be done with wildcard filesets on a directory, but I would like to control which files are operated on using a list.

Thanks, Rob.
19 years ago