File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

wsimport failure with .NET 2.0 wsdl

 
Rob Wednesday
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
WSIT (web service interoperability technologies) only supports interoperability between certain versions of .NET and Java web services/web service clients.
As far as I have seen, .NET 2.0 is not supported - is it possible for you to upgrade to .NET 3.0 or 3.5?
For more information, please refer to the WSIT web page: http://wsit.java.net/
Best wishes!
 
Rob Wednesday
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
I am not sure I can help - the construct causing the error indeed looks strange.
Cannot say I have seen anything like that before.
How does the requests generated by soapUI look?
Do you receive any responses when sending a request from soapUI to the web service?

It is possible to write a web service client in Java without using generated artifacts.
In such a case one would use the SAAJ API to create and send SOAP messages.
This may be an option you want to consider. Not the most elegant solution.
Best wishes!
 
Naren Chivukula
Ranch Hand
Posts: 577
Java Notepad Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Rob,

Your question is very interesting indeed.

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?

2. I see the schema declaration is not conforming to namepace.

ref attribute should point to valid element instance which is already defined.

Let us know if this could be of any help.



 
Rob Wednesday
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic