Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7742973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:24:51+00:00 2026-06-01T09:24:51+00:00

I am developing a webservice – I have cretaed a TestWebserive to pass across

  • 0

I am developing a webservice – I have cretaed a TestWebserive to pass across the data I want. Basically it will read in an XML file, use an XSL to transform it and then pass it on.

So the XML I am reading in is as follows:

                                <utcc:OrderItemAttribute>
                                    <utcc:AttributeName>Value1</utcc:AttributeName>
                                    <utcc:AttributeValue>1</utcc:AttributeValue>
                                </utcc:OrderItemAttribute>
                                <utcc:OrderItemAttribute>
                                    <utcc:AttributeName>Value2</utcc:AttributeName>
                                    <utcc:AttributeValue>2</utcc:AttributeValue>
                                </utcc:OrderItemAttribute>
                                <utcc:OrderItemAttribute>
                                    <utcc:AttributeName>Value3</utcc:AttributeName>
                                    <utcc:AttributeValue>3</utcc:AttributeValue>
                                </utcc:OrderItemAttribute>
                                <utcc:OrderItemAttribute>
                                    <utcc:AttributeName>Value4</utcc:AttributeName>
                                    <utcc:AttributeValue>4</utcc:AttributeValue>
                                </utcc:OrderItemAttribute>
                                <utcc:OrderItemAttribute>
                                    <utcc:AttributeName>Value5</utcc:AttributeName>
                                    <utcc:AttributeValue>5</utcc:AttributeValue>
                                </utcc:OrderItemAttribute>
                                <utcc:OrderItemAttribute>
                                    <utcc:AttributeName>Value6</utcc:AttributeName>
                                    <utcc:AttributeValue>6</utcc:AttributeValue>
                                </utcc:OrderItemAttribute>
                                <utcc:OrderItemAttribute>
                                    <utcc:AttributeName>Value7</utcc:AttributeName>
                                    <utcc:AttributeValue>7</utcc:AttributeValue>
                                </utcc:OrderItemAttribute>
                                <utcc:OrderItemAttribute>
                                    <utcc:AttributeName>Value8</utcc:AttributeName>
                                    <utcc:AttributeValue>8</utcc:AttributeValue>
                                </utcc:OrderItemAttribute>
                                <utcc:OrderItemAttribute>
                                    <utcc:AttributeName>Value9</utcc:AttributeName>
                                    <utcc:AttributeValue>9</utcc:AttributeValue>
                                </utcc:OrderItemAttribute>

So I then have an OrderInput class and within it the following code:

private OrderItemAttribute[] orderItemAttribute;

[XmlElement("OrderItemAttribute")]
        public OrderItemAttribute[] OrderItemAttribute
        {
            get { return orderItemAttribute; }
            set { orderItemAttribute = value; }
        }

and then another class – OrderItemAttribute which has the following:

    private string attributeName;
    private string attributeValue;

    [XmlElement("AttributeName")]
    public string AttributeName
    {
        get { return attributeName; }
        set { attributeName = value; }
    }

    [XmlElement("AttributeValue")]
    public string AttributeValue
    {
        get { return attributeValue; }
        set { attributeValue = value; }
    }

Now within my Test Webservice I have the following to pass in test values:

 orderInput.OrderItemAttribute[0].AttributeName = "Value1TestName";
 orderInput.OrderItemAttribute[0].AttributeValue = "Value1TestValue";

I am wondering instead of doing this for all [1] [2], etc is there a way I can do a foreach loop on this and read in all the values?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T09:24:53+00:00Added an answer on June 1, 2026 at 9:24 am

    Becuase OrderItemAttribute is a array if think you should be able to something like this:

    foreach(var order in orderInput.OrderItemAttribute)
        {
            order.AttributeName="Value1TestName";
            order.AttributeValue="Value1TestValue";
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing a system that will receive a XML (XmlDocument) via webservice. I
i'm developing an app that make requests to the Musicbrainz webservice. I read in
I'm developing a Silverlight 3 Application which I want to connect to a webservice
I'm developing a webservice that will, when called, notify another program via a tcp
I am using Apache CXF for developing Web services . I have a Webservice
When developing an application which consumes an external webservice I have generated the sources
I am developing the framework for what will be a large data-driven Silverlight application
I am developing an Android widget. I have an initial layout from the XML
I'm developing an asp.net webservice application to provide json-formatted data to a widget that
I am developing an Windows phone7 application, I have a .NET webservice that returns

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.