Discussion:
.NET and XSD element having a complexType
Silvano Girardi Jr
2008-01-09 22:02:11 UTC
Permalink
Hi all,

I am trying to use many-valued elements. They work fine when using with PHP,
but when I try .NET I get the following:
------------------------------
D:\wsdl>wsdl.exe http://localhost/tests/ContactService.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.
Error: Unable to import binding 'ContactServiceBinding' from namespace '
http://ContactService'.
- Unable to import operation 'report'.
- The datatype 'http://example.org:CustomerPlan' is missing.

If you would like more help, please type "wsdl /?".
------------------------------

My XSD looks like:

------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="
http://example.org" xmlns:tns="http://example.org">

<xs:complexType name="SinglePlan">
<xs:sequence>
<xs:element name="id" type="xs:integer" />
<xs:element name="name" type="xs:string" />
</xs:sequence>
</xs:complexType>

<xs:element name="CustomerPlan">
<xs:complexType>
<xs:sequence>
<xs:element name="CustomerPlans" type="tns:SinglePlan"
maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
</xs:element>

</xs:schema>
------------------------------

I noticed that if I change the XSD to:
------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="
http://example.org" xmlns:tns="http://example.org">

<xs:complexType name="SinglePlan">
<xs:sequence>
<xs:element name="id" type="xs:integer" />
<xs:element name="name" type="xs:string" />
</xs:sequence>
</xs:complexType>

<xs:complexType name="CustomerPlan">
<xs:sequence>
<xs:element name="CustomerPlans" type="tns:SinglePlan"
maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>

</xs:schema>
------------------------------

it works fine.
What can I do to make the first one work?

Thanks
Silvano

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
simonslaws-gM/Ye1E23mwN+
2008-01-10 08:59:59 UTC
Permalink
Post by Silvano Girardi Jr
Hi all,
I am trying to use many-valued elements. They work fine when using with PHP,
------------------------------
D:\wsdl>wsdl.exehttp://localhost/tests/ContactService.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.
Error: Unable to import binding 'ContactServiceBinding' from namespace 'http://ContactService'.
- Unable to import operation 'report'.
- The datatype 'http://example.org:CustomerPlan'is missing.
If you would like more help, please type "wsdl /?".
------------------------------
------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://example.org" xmlns:tns="http://example.org">
<xs:complexType name="SinglePlan">
<xs:sequence>
<xs:element name="id" type="xs:integer" />
<xs:element name="name" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:element name="CustomerPlan">
<xs:complexType>
<xs:sequence>
<xs:element name="CustomerPlans" type="tns:SinglePlan"
maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
------------------------------
------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://example.org" xmlns:tns="http://example.org">
<xs:complexType name="SinglePlan">
<xs:sequence>
<xs:element name="id" type="xs:integer" />
<xs:element name="name" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="CustomerPlan">
<xs:sequence>
<xs:element name="CustomerPlans" type="tns:SinglePlan"
maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
</xs:schema>
------------------------------
it works fine.
What can I do to make the first one work?
Thanks
Silvano
Hi Silvano

What does the XSD that uses these types look like? If you have
something like <xs:element name="someElement"
type="example:CustomerPlan" /> Then I would expect you to have to use
the second version of the XSD.

Regards

Simon

Loading...