Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / February 2008

Tip: Looking for answers? Try searching our database.

CR: Using XML Items

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tony - 12 Feb 2008 13:20 GMT
I am developing web aplication in C#. I need to connect to some web service.
I need to enter value for some fields, but these fields are not included in
this object. My wsdl is this:
     <xsd:complexType name="NameRQ">
       <xsd:sequence>
         <xsd:element name="RowNumber" type="xsd:int" />
         <xsd:choice>
           <xsd:element minOccurs="1" maxOccurs="1" name="GuestCode"
type="xsd:string" />
           <xsd:sequence>
             <xsd:element minOccurs="0" maxOccurs="1" name="FirstName"
type="xsd:string" />
             <xsd:element minOccurs="0" maxOccurs="1" name="MiddleName"
type="xsd:string" />
             <xsd:element name="LastName" type="xsd:string" />
             <xsd:element minOccurs="0" maxOccurs="1" name="DateOfBirth"
type="xsd:string" />
             <xsd:element name="Gender" type="xsd:string" />
             <xsd:element minOccurs="0" maxOccurs="1" name="Nationality"
type="xsd:string" />
             <xsd:element minOccurs="0" maxOccurs="1" name="Disable"
type="xsd:boolean" />
             <xsd:element minOccurs="0" maxOccurs="1" name="PassportNumber"
type="xsd:string" />
             <xsd:element minOccurs="0" maxOccurs="1"
name="PassportExpiryDate" type="xsd:string" />
             <xsd:element minOccurs="0" maxOccurs="1" name="GuestTypeCode"
type="xsd:string" />
           </xsd:sequence>
         </xsd:choice>
       </xsd:sequence>
     </xsd:complexType>

I can declare NameRQ object in C#, but I can find only RowNumber property
(first property in WSDL). Other fields is not present in intellisense. I am
trying to declare object ItemsChoiceType which have this fields
(ItemsChoiceType.FirstName, ItemsChoiceType.LastName etc.). Problem is how
to add some String to this fields (like "Jim" for the FirstName, "Morrison"
for the last name etc.). I am trying like this:

ItemsChoiceType[] ItemsChoiceTypeObj = new ItemsChoiceType[8];
ItemsChoiceTypeObj[0] = new ItemsChoiceType();

I can add this now:
ItemsChoiceTypeObj[0] =ItemsChoiceType.FirstName;

But on that way I can add only field FirstName, but how can I add Value for
the first name (John, Jim, Jack...)
Any idea? I need code in C# or VB.NET (maybe Java code can also help)

Thanks
Peter Bromberg [C# MVP] - 12 Feb 2008 14:01 GMT
The last code line in your example makes no sense.
You should be able to do this (for example):

ItemsChoiceTypeObj[0].FirstName = "John";
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
MetaFinder: http://www.blogmetafinder.com 

> I am developing web aplication in C#. I need to connect to some web service.
> I need to enter value for some fields, but these fields are not included in
[quoted text clipped - 47 lines]
>
> Thanks
Marc Gravell - 12 Feb 2008 14:01 GMT
Well it is hard to tell since this isn't exactly complete or clear;
however as far as I can tell, the following should work:

           YourType foo = new YourType();
           foo.ItemsElementName = new ItemsChoiceType[] {
ItemsChoiceType.LastName, ItemsChoiceType.FirstName };
           foo.Items = new object[] { "Flintstone", "Fred" };

Any use?

Marc

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.