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 9216847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T02:30:13+00:00 2026-06-18T02:30:13+00:00

Here is my current situation. I had to break standards for how to do

  • 0

Here is my current situation. I had to break standards for how to do web services calls. We had 60+ WSDLs to connect to and the name changed based on a parameter. I created the web service call dynamically using a WebClient and built the envelope manually (it was decided to do this instead of adding each web service by upper management). I get a string response back that has the valid XML that matches the XSD. I’m trying to figure out how to create a class to reference the fields dynamically instead of a class per WSDL (build a class based on the XSD being used). Here is what I’m doing:

public string results;

using (WebClient client = new WebClient())
{
    string soapENV = @"http://schemas.xmlsoap.org/soap/envelope/";
    var payload = @"<?xml version=""1.0"" encoding=""utf-8""?>" +
                   "<SOAP-ENV:Envelope xmlns:SOAP-ENV='" + soapENV + "'>" +
                     "<SOAP-ENV:Header/>" + 
                       "<SOAP-ENV:Body>" + 
                         "<" + myParams.requestName + " xmlns='" +    
                             myParams.requestNamespace + "'>" +
                           "<MtvnSvcVer>1.0</MtvnSvcVer>" + 
                           "<MsgUUID>" + UUID + "</MsgUUID>" + 
                           "<PrcsParms>" + 
                           "<SrcID>" + currentVendorID + "</SrcID>" + 
                           "</PrcsParms>"
                           ................
                       "</SOAP-ENV:Body>" + 
                     "</SOAP-ENV:Envelope>";
   this.results = client.UploadString  (URL, payload);
}

For the sake of saving time and space I took out some of the XML tags. The XSD response has the same values for XML tags as above. I then call this to be executed as follows:

string results = connectwareService.InvokeConnectWare();

The results returned look like this:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
  <soapenv:Body>        
    <DPNmeAddrInqMtvnSvcRes  xmlns="mtvnCWDPNmeAddrInqSvcRes"> 
     <MtvnSvcVer>1.0</MtvnSvcVer>
     <MsgUUID>DATA HERE</MsgUUID>           
      <Svc>
       <SvcParms>
         <ApplID>DATA HERE</ApplID>
         <SvcID>DATA HERE</SvcID>
         <SvcVer>1.0</SvcVer>
         <RqstUUID>DATA HERE</RqstUUID>
       </SvcParms>
       <MsgData>
       <DPNmeAddrInqResData xmlns="mtvnCWDPNmeAddrInqResData">
         <E20007>DATA HERE</E20007>
        ........    
   </soapenv:Body> 
</soapenv:Envelope>

Is there a way in the code to do this? I keep seeing peopele refer to using xsd.exe. Can that be executed in code behind? I was thinking that I could read through and populate a generic class with the tag name as a name and the data as a value as last resort but there has to be a way to generate this on the fly in the code. I guess another way I could do it is read all 60+ wsdls and run xsd.exe to build the classes needed?

Also, Just some FYI – I’m converting old Cold Fusion code to C# and I’m trying to figure out how to replace its “ConvertXmlToStruct” method. Any help would be greatly appreciated.

  • 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-18T02:30:15+00:00Added an answer on June 18, 2026 at 2:30 am

    xsd.exe is only run once to build a class file that represents the objects defined in the XSD. You then use an XmlSerializer class to actually convert (aka deserialize) the XML to the c# class.

    There are a lot of links out there talking about deserializing XML in C#:

    How to use xsd in c#?

    http://msdn.microsoft.com/en-us/library/ms950721.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is my current situation: I have a web page containing a couple scrollable
Here's my current situation: I have a NSMutableArray named dictKeyArray which I assign a
Here is my current situation; I am a near complete regexp illiterate, and have
Here's my current situation: import java.util.ArrayList; import java.util.Scanner; import com.sun.xml.internal.ws.api.pipe.NextAction; import static java.lang.System.*; public
Here is my current situation: I have two tm structs, both set to the
Here's the current situation I'm in: I want to distribute a binary app on
Here is my current situation: I have a user class that has an attribute
Here's a picture of my current situation : alt text http://grab.by/FUM But I don't
here's my current situation: I am working on a rails engine ( awesome_engine ).
Here's my current situation: Eclipse Win7 Samsung SII (for testing) I am writing an

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.