Discussion:
Error in Web Services Description Language Tool
Tatto de Castro
2007-11-12 17:16:03 UTC
Permalink
Hi everybody,

I'm having a strange problem when I try to use the Web Services
Description Language Tool (Wsdl.exe) from .NET Framework Tools. I'm
getting an error when I try to use the wsdl.exe to create the C# client
proxy class based on the wsdl generated by PHP (SCA_SDO).
I tried several ways to make the wsdl.exe create the C# code. Does
anyone have any idea about how to solve this problem? Anyone else having
this problem too?
The info about how to reproduce the error follows below.

Thanks, Tatto

Command that I'm getting error:
wsdl.exe /protocol:SOAP /language:CS /out:"TestService.cs" Test.wsdl
+++++++++++++++
Error message:
Microsoft (R) Web Services Description Language Utility
[Microsoft (R) .NET Framework, Version 2.0.50727.42]
Copyright (C) Microsoft Corporation. All rights reserved.
Warning: This web reference does not conform to WS-I Basic Profile v1.1.
R2028, R2029: A DESCRIPTION using the WSDL namespace and the WSDL SOAP
binding n
amespace MUST be valid according to the XML Schemas found at
http://schemas.xmls
oap.org/wsdl/2003-02-11.xsd and
http://schemas.xmlsoap.org/wsdl/soap/2003-02-11.
xsd.
- Warning: The element 'definitions' in namespace
'http://schemas.xmlsoap.org
/wsdl/' has invalid child element 'types'. List of possible elements
expected: '
documentation, import, types, message, portType, binding, service' in
namespace
'http://schemas.xmlsoap.org/wsdl/' as well as any element in namespace
'##other'
. Line 3, position 4.

For more details on the WS-I Basic Profile v1.1, see the specification
at http://www.ws-i.org/Profiles/BasicProfile-1.1.html.

Error: Unable to import binding 'TestBinding' from namespace 'http://Test'.
- Unable to import operation 'giveMeANumber'.
- The element 'http://Test:giveMeANumber' is missing.

If you would like more help, please type "wsdl /?".
+++++++++++++++
Test.php:
<?php
require_once( "SCA/SCA.php" );

/**
* Class Test
*
* @service
* @binding.soap
*/
class Test {

/**
* Checks for an existing cart
*
* @return string
*/
public function giveMeANumber( ) {
return 'Your number is :' . rand(1,100);
}

}
?>
+++++++++++++++
Test.wsdl:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:tns2="http://Test"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
targetNamespace="http://Test">
<types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://Test"
elementFormDefault="qualified">
<xs:element name="giveMeANumber">
<xs:complexType>
<xs:sequence>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="giveMeANumberResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="giveMeANumberReturn" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</types>
<wsdl:message name="giveMeANumberRequest">
<wsdl:part name="giveMeANumberRequest" element="tns2:giveMeANumber"/>
</wsdl:message>
<wsdl:message name="giveMeANumberResponse">
<wsdl:part name="return" element="tns2:giveMeANumberResponse"/>
</wsdl:message>
<wsdl:portType name="TestPortType">
<wsdl:operation name="giveMeANumber">
<wsdl:input message="tns2:giveMeANumberRequest"/>
<wsdl:output message="tns2:giveMeANumberResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="TestBinding" type="tns2:TestPortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document"/>
<wsdl:operation name="giveMeANumber">
<soap:operation soapAction=""/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="TestService">
<wsdl:port name="TestPort" binding="tns2:TestBinding">
<soap:address location="http://localhost/Test.php"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

<!-- this line identifies this file as WSDL generated by SCA for PHP. Do
not remove -->
+++++++++++++++
PHP Version: 5.2.3
SCA_SDO Version: 1.2.3

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "phpsoa" group.
To post to this group, send email to phpsoa-/***@public.gmane.org
To unsubscribe from this group, send email to phpsoa-unsubscribe-/***@public.gmane.org
For more options, visit this group at http://groups.google.co.uk/group/phpsoa?hl=en
-~----------~----~----~----~------~----~------~--~---
Paul Scott
2007-11-13 09:48:09 UTC
Permalink
Post by Tatto de Castro
I'm having a strange problem when I try to use the Web Services
Description Language Tool (Wsdl.exe) from .NET Framework Tools. I'm
getting an error when I try to use the wsdl.exe to create the C#
client proxy class based on the wsdl generated by PHP (SCA_SDO).
Could you try and use the same tool for the URL
http://fsiu.uwc.ac.za/chisimba_modules/webservices/server.php?wsdl as
well? That service looks like the same type of thing as well and I would
like to know if you get the same issue.

Are any of the project developers alive on this list?

--Paul
--
Please avoid sending me Word or PowerPoint attachments.
Caroline Maynard
2007-11-13 10:23:26 UTC
Permalink
Post by Paul Scott
Post by Tatto de Castro
I'm having a strange problem when I try to use the Web Services
Description Language Tool (Wsdl.exe) from .NET Framework Tools. I'm
getting an error when I try to use the wsdl.exe to create the C#
client proxy class based on the wsdl generated by PHP (SCA_SDO).
Could you try and use the same tool for the URL
http://fsiu.uwc.ac.za/chisimba_modules/webservices/server.php?wsdl as
well? That service looks like the same type of thing as well and I would
like to know if you get the same issue.
Are any of the project developers alive on this list?
Alive, just sleeping ...

It's sad but true that different programs don't have the same criteria
for deciding what is valid WSDL. If you look back in the mailing list or
in our bugs list, you'll see there have been a couple of issues about
the .NET tools being quite picky compared to Tuscany (the Apache library
that we use to implement this stuff). It's only with real examples like
yours that we can home in on the discrepancies, so thanks for sending
them. We'll take a look and see what can be done.
Paul Scott
2007-11-13 11:04:05 UTC
Permalink
Post by Caroline Maynard
Alive, just sleeping ...
Sleep, whats that? Coffee.... ;)
Post by Caroline Maynard
It's sad but true that different programs don't have the same criteria
for deciding what is valid WSDL. If you look back in the mailing list or
in our bugs list, you'll see there have been a couple of issues about
the .NET tools being quite picky compared to Tuscany (the Apache library
that we use to implement this stuff). It's only with real examples like
yours that we can home in on the discrepancies, so thanks for sending
them. We'll take a look and see what can be done.
Agreed, absolutely! I have only just started out on this stuff, and it
seems really promising. I am going to try and expose a whole whack of
things from our framework being used to deliver e-learning in 16 African
countries in this method, so I will try and keep you all up to date as
well.

For some background on our project, please check out
http://avoir.uwc.ac.za

Will check in later again, I just have to try and figure out a decent
way of generating XSD for complexTypes generically...

--Paul
--
Please avoid sending me Word or PowerPoint attachments.
Tatto de Castro
2007-11-13 12:50:12 UTC
Permalink
Hi everybody,

Thanks for the help Caroline Maynard, if there is something that I
can do, let me know.
I already tried to edit the wsdl file without success. Any other idea?

Paul Scott, the problem happens with your wsdl too (error message
follows below).

Thanks, Tatto

+++++++
Post by Tatto de Castro
wsdl.exe
http://fsiu.uwc.ac.za/chisimba_modules/webservices/server.php?wsdl
Microsoft (R) Web Services Description Language Utility
[Microsoft (R) .NET Framework, Version 2.0.50727.42]
Copyright (C) Microsoft Corporation. All rights reserved.
Warning: This web reference does not conform to WS-I Basic Profile v1.1.
R2028, R2029: A DESCRIPTION using the WSDL namespace and the WSDL SOAP
binding namespace MUST be valid according to the XML Schemas found at
http://schemas.xmlsoap.org/wsdl/2003-02-11.xsd and
http://schemas.xmlsoap.org/wsdl/soap/2003-02-11.xsd.
- Warning: The element 'definitions' in namespace
'http://schemas.xmlsoap.org/wsdl/' has invalid child element 'types'.
List of possible elements expected: 'documentation, import, types,
message, portType, binding, service' in
namespace'http://schemas.xmlsoap.org/wsdl/' as well as any element in
namespace '##other'. Line 3, position 4.

For more details on the WS-I Basic Profile v1.1, see the specification
at http://www.ws-i.org/Profiles/BasicProfile-1.1.html.

Error: Unable to import binding 'serverBinding' from namespace
'http://server'.
- Unable to import operation 'hello'.
- The element 'http://server:hello' is missing.

If you would like more help, please type "wsdl /?".
+++++++
Post by Tatto de Castro
Post by Caroline Maynard
Alive, just sleeping ...
Sleep, whats that? Coffee.... ;)
Post by Caroline Maynard
It's sad but true that different programs don't have the same criteria
for deciding what is valid WSDL. If you look back in the mailing list or
in our bugs list, you'll see there have been a couple of issues about
the .NET tools being quite picky compared to Tuscany (the Apache library
that we use to implement this stuff). It's only with real examples like
yours that we can home in on the discrepancies, so thanks for sending
them. We'll take a look and see what can be done.
Agreed, absolutely! I have only just started out on this stuff, and it
seems really promising. I am going to try and expose a whole whack of
things from our framework being used to deliver e-learning in 16 African
countries in this method, so I will try and keep you all up to date as
well.
For some background on our project, please check out
http://avoir.uwc.ac.za
Will check in later again, I just have to try and figure out a decent
way of generating XSD for complexTypes generically...
--Paul
------------------------------------------------------------------------
All Email originating from UWC is covered by disclaimer
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "phpsoa" group.
To post to this group, send email to phpsoa-/***@public.gmane.org
To unsubscribe from this group, send email to phpsoa-unsubscribe-/***@public.gmane.org
For more options, visit this group at http://groups.google.co.uk/group/phpsoa?hl=en
-~----------~----~----~----~------~----~------~--~---
Paul Scott
2007-11-13 12:59:43 UTC
Permalink
Post by Tatto de Castro
Paul Scott, the problem happens with your wsdl too (error message
follows below).
If I am not mistaken, the nameSpace is (one) of the problems there. I
need to fully qualify that at least before you try again. Thanks Tatto,
appreciate the feedback. We will certainly need to help each other out
here!

--Paul
--
Please avoid sending me Word or PowerPoint attachments.
Rob
2007-11-14 12:47:10 UTC
Permalink
Hi Caroline,
Post by Caroline Maynard
It's sad but true that different programs don't have the same criteria
for deciding what is valid WSDL. If you look back in the mailing list or
in our bugs list, you'll see there have been a couple of issues about
the .NET tools being quite picky compared to Tuscany (the Apache library
that we use to implement this stuff). It's only with real examples like
yours that we can home in on the discrepancies, so thanks for sending
them. We'll take a look and see what can be done.
The type element needs to be within the wsdl namespace (http://
schemas.xmlsoap.org/wsdl/).
.NET code generator tool must be validating the WSDL against the WSDL
schema.

Rob
Matthew Peters
2007-11-19 11:14:54 UTC
Permalink
Rob is exactly right.

If you change two lines in SCA/Bindings/soap/
ServiceDescriptionGenerator.php to add the namespace prefix "wsdl" to
the generated wsdl, it will validate. Sorry about that.

I have checked in a change which will be in the next release.

Line 196 should read
$types_element = '<wsdl:types>'

Line 286 should read
$types_element .= ' </wsdl:types>' . "\n";


Matthew
Post by Rob
The type element needs to be within the wsdl namespace (http://
schemas.xmlsoap.org/wsdl/).
.NET code generator tool must be validating the WSDL against the WSDL
schema.
Rob
Silvano Jr
2007-11-19 13:27:24 UTC
Permalink
Thank you for exposing the solution, guys.
I work with Tatto and I have made the modifications on the file and we
were able to generate the proxy.

Do you have an estimated date for the next release?

Regards,
Silvano
Post by Matthew Peters
Rob is exactly right.
If you change two lines in SCA/Bindings/soap/
ServiceDescriptionGenerator.php to add the namespace prefix "wsdl" to
the generated wsdl, it will validate. Sorry about that.
I have checked in a change which will be in the next release.
Line 196 should read
$types_element = '<wsdl:types>'
Line 286 should read
$types_element .= ' </wsdl:types>' . "\n";
Matthew
Post by Rob
The type element needs to be within the wsdl namespace (http://
schemas.xmlsoap.org/wsdl/).
.NET code generator tool must be validating the WSDL against the WSDL
schema.
Rob
Continue reading on narkive:
Loading...