Skip to main content

wsimport from SVCUTIL generated files - doesn't work

2 replies [Last post]
Anonymous

I'm new comer to metro and I've tried to generate the java classes in order
to invoke WCF service example but found the following:

1. Microsoft svcutil generated two wsdl files + schema files (see info
below) so when I point wsimport to an existing wsdl file which one should I
use?

2. I've tried to point to each wsdl file in turn but nothing works - see
below the two transcripts

3. I've succeeded to generate the files only when wsimport ran against a
"live" WCF service (and later successsfuly invoked the wcf service) - but
this is not what I need

4. I've also tried to find a class that will generate the files at runtime
but didn't find. Is there anything like this in metro?

Can someone answer this?

*-----------------------------------------------------------*
WCF generated files by svcutil:

schemas.microsoft.com.2003.10.Serialization.xsd
www.thatindigogirl.com.samples.2006.06.xsd
*www.thatindigogirl.com.samples.2006.06.wsdl
tempuri.org.wsdl*

-----------------------------------------------------------
running wsimport against the first wsdl file:

C:\smf\workspace\metroTesters\src>%metro_home%\bin\wsimport -verbose
-Xnocompile -d FromWSDL
"C:\wsdl-export\HelloIndigo_Part1\www.thatindigogirl.com.samples.2006.06.wsdl"

C:\smf\workspace\metroTesters\src>"C:\Program
Files\Java\jdk1.6.0_04\bin\java"
-jar "C:\metro\lib\webservices-tools.jar" -verbose -Xnocompile -d FromWSDL
"C:\wsdl-export\HelloIndigo_Part1\www.thatindigogirl.com.samples.2006.06.wsdl"
parsing WSDL...

[ERROR] failed.noservice=Could not find wsdl:service in the provided
WSDL(s):

file:/C:/wsdl-export/HelloIndigo_Part1/www.thatindigogirl.com.samples.2006.06.wsdl
At least one WSDL with at least one service definition needs to be
provided.

Failed to parse the WSDL.

-----------------------------------------------------------
running wsimport against the second wsdl file:

C:\smf\workspace\metroTesters\src>%metro_home%\bin\wsimport -verbose
-Xnocompile
-d FromWSDL "C:\wsdl-export\HelloIndigo_Part1\tempuri.org.wsdl"

C:\smf\workspace\metroTesters\src>"C:\Program
Files\Java\jdk1.6.0_04\bin\java"
-jar "C:\metro\lib\webservices-tools.jar" -verbose -Xnocompile -d FromWSDL
"C:\w
sdl-export\HelloIndigo_Part1\tempuri.org.wsdl"
parsing WSDL...

[ERROR] Content is not allowed in prolog.
line 1 of file:/C:/wsdl-export/HelloIndigo_Part1/

05/03/2009 10:36:29 com.sun.xml.ws.mex.client.MetadataClient
retrieveMetadata
WARNING: MEX0008:Failed to parse metadata returned from server at
file:/C:/wsdl-
export/HelloIndigo_Part1/tempuri.org.wsdl using protocol SOAP_1_2.
Continuing attempts.
05/03/2009 10:36:30 com.sun.xml.ws.mex.client.MetadataClient
retrieveMetadata
WARNING: MEX0008:Failed to parse metadata returned from server at
file:/C:/wsdl-
export/HelloIndigo_Part1/tempuri.org.wsdl using protocol SOAP_1_1.
Continuing attempts.
05/03/2009 10:36:30 com.sun.xml.ws.mex.client.MetadataClient
retrieveMetadata
WARNING: MEX0008:Failed to parse metadata returned from server at
file:/C:/wsdl-
export/HelloIndigo_Part1/tempuri.org.wsdl/mex using protocol SOAP_1_2.
Continuing attempts.
05/03/2009 10:36:30 com.sun.xml.ws.mex.client.MetadataClient
retrieveMetadata
WARNING: MEX0008:Failed to parse metadata returned from server at
file:/C:/wsdl-
export/HelloIndigo_Part1/tempuri.org.wsdl/mex using protocol SOAP_1_1.
Continuing attempts.
[ERROR] Content is not allowed in prolog.

Failed to read the WSDL document:
file:/C:/wsdl-export/HelloIndigo_Part1/tempuri.org.wsdl,
because
1) could not find the document;
/2) the document could not be read;
3) the root element of the document is not .

[ERROR] failed.noservice=Could not find wsdl:service in the provided
WSDL(s):

file:/C:/wsdl-export/HelloIndigo_Part1/tempuri.org.wsdl
At least one WSDL with at least one service definition needs to be
provided.

Failed to parse the WSDL.

-------------------------------------------------------------------------------------------------------------------
content of tempuri.org.wsdl:

<?xml version="1.0" encoding="utf-8"?>

----------------------------------------------------------------------------------------------------------------------
content of the second wsdl file:

<?xml version="1.0" encoding="utf-8"?>

[att1.html]

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
rythos
Offline
Joined: 2004-08-31

Just ran into this problem today, and while searching for an answer came across your question. Solved it today as well!

The reason is that apparently svcutil doesn't fill in any elements in any of your generated files.

Like this:

If any of your other files also have import elements in them, you'll have to modify those as well. I had a few inside my second WSDL which required that I add "schemaLocation=''" into the element.

I'm now looking into seeing if we can't add this information at generation time, but thought I'd respond here first. We're having the same problem on the same day...:)

Good luck!

Avi Grossbard

This might explain why the WSIT/Metro manual is geared toward WCF clients
calling Java based web services....

Anyway,
I find a way to get a single WSDL which contains most of the tags except for
the which I had to add it manualy.
This was happend when I generated the wsdl & schema files by running the
svcutil in the following manner:
svcutil /t:metadat myService.exe

I think that svcutil expect to get the service name with the option
/serviceName:xxx
I've tried that but it also returned to me some error so I've never
succesded with this option.

I feel that once I'll find the way to run the command with the wsdl file +
the /serviceName option
Then a single complete wsdl file will be generated.

Thanks

On Fri, Mar 6, 2009 at 12:18 AM, wrote:

> Just ran into this problem today, and while searching for an answer came
> across your question. Solved it today as well!
>
> The reason is that apparently svcutil doesn't fill in any elements
> in any of your generated files.
>
> Like this:
> > location="www.thatindigogirl.com.samples.2006.06.wsdl" />
>
> If any of your other files also have import elements in them, you'll have
> to modify those as well. I had a few inside my second WSDL which required
> that I add "schemaLocation=''" into the element.
>
> I'm now looking into seeing if we can't add this information at generation
> time, but thought I'd respond here first. We're having the same problem on
> the same day...:)
>
> Good luck!
> [Message sent by forum member 'rythos' (rythos)]
>
> http://forums.java.net/jive/thread.jspa?messageID=335410
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@metro.dev.java.net
> For additional commands, e-mail: users-help@metro.dev.java.net
>
>
[att1.html]