.NET and XSD element having a complexType

View: New views
2 Messages — Rating Filter:   Alert me  

.NET and XSD element having a complexType

by Silvano Girardi Jr-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...
To unsubscribe from this group, send email to phpsoa-unsubscribe@...
For more options, visit this group at http://groups.google.co.uk/group/phpsoa?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: .NET and XSD element having a complexType

by Simon Laws :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message




On 9 Jan, 22:02, "Silvano Girardi Jr" <silvan...@...> wrote:

> 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.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 /?".
> ------------------------------
>
> 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
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
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "phpsoa" group.
To post to this group, send email to phpsoa@...
To unsubscribe from this group, send email to phpsoa-unsubscribe@...
For more options, visit this group at http://groups.google.co.uk/group/phpsoa?hl=en
-~----------~----~----~----~------~----~------~--~---