Link to home
Start Free TrialLog in
Avatar of rwallacej
rwallacej

asked on

SOAP .Net XML text file

I have result of web service function in a XML text file. It cane from the guy who setup service
I can't connect to the service yet til I get permissions, so simple "add service" in visual studio does nothing

I'd like to have the XML as .vb classes etc., write code on it an so on, just like you can when using "add reference "

Can I do anything like this from XML file only? So simulate connect to service whilst waiting for it ?
Avatar of rwallacej
rwallacej

ASKER

A better description might be how to "decode" to make a class with properties to match the XML
Or how to put the XML soap text into a "presentable" format as objects/vb classes for processing
example SOAP returned is as follows: note I have stripped this down, it mightn't be valid now

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Body>
      <ns1:blahBlah soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="com.z">
         <abcd soapenc:arrayType="ns1:measValueWSVO[10]" xsi:type="soapenc:Array"
             xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
            <abcd href="#id0"/>
            <abcd href="#id1"/>
            <abcd href="#id2"/>
            <abcd href="#id3"/>
            <abcd href="#id4"/>
            <abcd href="#id5"/>
            <abcd href="#id6"/>
            <abcd href="#id7"/>
            <abcd href="#id8"/>
            <abcd href="#id9"/>
         </abcd>
      </ns1:blahBlah>
      <multiRef id="id1" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
        xsi:type="ns2:measValueWSVO" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
        xmlns:ns2="com.z">
         <charvalue xsi:type="soapenc:string" xsi:nil="true"/>
         <errorNumber xsi:type="soapenc:string"/>
         <errorText xsi:type="soapenc:string"/>
         <ddd xsi:type="soapenc:string">aaa</ddd>
         <zzz xsi:type="soapenc:string">1007</zzz>
         <eee xsi:type="soapenc:string">Attribution</eee>
         <mID xsi:type="soapenc:string">zzzddd</mID>
         <jjj xsi:type="soapenc:string">aaavvv</jjj>
         <measurementType xsi:type="soapenc:string">GGG</measurementType>
         <numericValue xsi:type="soapenc:string">18.020000</numericValue>
         <objectDescription xsi:type="soapenc:string">jjj FFF</objectDescription>
         <objectId xsi:type="soapenc:string">1007</objectId>
         <objectName xsi:type="soapenc:string">jjj FFF</objectName>
         <scenario xsi:type="soapenc:string">PROVISIONAL</scenario>
         <timestamp xsi:type="soapenc:string">13/01/2014 06:00</timestamp>
         <units xsi:type="soapenc:string">kSm3</units>
      </multiRef>
      <multiRef id="id8" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns3:measValueWSVO" xmlns:ns3="com.z" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
         <charvalue xsi:type="soapenc:string" xsi:nil="true"/>
         <errorNumber xsi:type="soapenc:string"/>
         <errorText xsi:type="soapenc:string"/>
         <ddd xsi:type="soapenc:string">KKKK</ddd>
         <zzz xsi:type="soapenc:string">1007</zzz>
         <eee xsi:type="soapenc:string">FFF IIIKKK PJKL Attributed </eee>
         <mID xsi:type="soapenc:string">FBPpNGL_ATT_M_GD</mID>
         <jjj xsi:type="soapenc:string">FBPpNGL,Att,M IOII</jjj>
         <measurementType xsi:type="soapenc:string">NGL_MASS</measurementType>
         <numericValue xsi:type="soapenc:string">4.381075</numericValue>
         <objectDescription xsi:type="soapenc:string">jjj FFF</objectDescription>
         <objectId xsi:type="soapenc:string">1007</objectId>
         <objectName xsi:type="soapenc:string">jjj FFF</objectName>
         <scenario xsi:type="soapenc:string">PROVISIONAL</scenario>
         <timestamp xsi:type="soapenc:string">13/01/2014 06:00</timestamp>
         <units xsi:type="soapenc:string">tonne</units>
      </multiRef>
ok...I see
var bytes = Encoding.UTF8.GetBytes(theMessageString);
var reader = XmlDictionaryReader.CreateTextReader(bytes, XmlDictionaryReaderQuotas.Max);

what next, what do I do with the reader?
ASKER CERTIFIED SOLUTION
Avatar of jitendra patil
jitendra patil
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial