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 ?
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 ?
ASKER
Or how to put the XML soap text into a "presentable" format as objects/vb classes for processing
ASKER
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:mea sValueWSVO [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:measValueWSV O" 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"> Attributio n</eee>
<mID xsi:type="soapenc:string"> zzzddd</mI D>
<jjj xsi:type="soapenc:string"> aaavvv</jj j>
<measurementType xsi:type="soapenc:string"> GGG</measu rementType >
<numericValue xsi:type="soapenc:string"> 18.020000< /numericVa lue>
<objectDescription xsi:type="soapenc:string"> jjj FFF</objectDescription>
<objectId xsi:type="soapenc:string"> 1007</obje ctId>
<objectName xsi:type="soapenc:string"> jjj FFF</objectName>
<scenario xsi:type="soapenc:string"> PROVISIONA L</scenari o>
<timestamp xsi:type="soapenc:string"> 13/01/2014 06:00</timestamp>
<units xsi:type="soapenc:string"> kSm3</unit s>
</multiRef>
<multiRef id="id8" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns3:measValueWSV O" 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_AT T_M_GD</mI D>
<jjj xsi:type="soapenc:string"> FBPpNGL,At t,M IOII</jjj>
<measurementType xsi:type="soapenc:string"> NGL_MASS</ measuremen tType>
<numericValue xsi:type="soapenc:string"> 4.381075</ numericVal ue>
<objectDescription xsi:type="soapenc:string"> jjj FFF</objectDescription>
<objectId xsi:type="soapenc:string"> 1007</obje ctId>
<objectName xsi:type="soapenc:string"> jjj FFF</objectName>
<scenario xsi:type="soapenc:string"> PROVISIONA L</scenari o>
<timestamp xsi:type="soapenc:string"> 13/01/2014 06:00</timestamp>
<units xsi:type="soapenc:string"> tonne</uni ts>
</multiRef>
<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:mea
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:measValueWSV
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">
<zzz xsi:type="soapenc:string">
<eee xsi:type="soapenc:string">
<mID xsi:type="soapenc:string">
<jjj xsi:type="soapenc:string">
<measurementType xsi:type="soapenc:string">
<numericValue xsi:type="soapenc:string">
<objectDescription xsi:type="soapenc:string">
<objectId xsi:type="soapenc:string">
<objectName xsi:type="soapenc:string">
<scenario xsi:type="soapenc:string">
<timestamp xsi:type="soapenc:string">
<units xsi:type="soapenc:string">
</multiRef>
<multiRef id="id8" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns3:measValueWSV
<charvalue xsi:type="soapenc:string" xsi:nil="true"/>
<errorNumber xsi:type="soapenc:string"/
<errorText xsi:type="soapenc:string"/
<ddd xsi:type="soapenc:string">
<zzz xsi:type="soapenc:string">
<eee xsi:type="soapenc:string">
<mID xsi:type="soapenc:string">
<jjj xsi:type="soapenc:string">
<measurementType xsi:type="soapenc:string">
<numericValue xsi:type="soapenc:string">
<objectDescription xsi:type="soapenc:string">
<objectId xsi:type="soapenc:string">
<objectName xsi:type="soapenc:string">
<scenario xsi:type="soapenc:string">
<timestamp xsi:type="soapenc:string">
<units xsi:type="soapenc:string">
</multiRef>
hi
try the below links.
How to create a WCF Message object from SOAP response XML
How to Parse a soap response returned by external webservice using C#
hope this helps.
try the below links.
How to create a WCF Message object from SOAP response XML
How to Parse a soap response returned by external webservice using C#
hope this helps.
ASKER
ok...I see
var bytes = Encoding.UTF8.GetBytes(the MessageStr ing);
var reader = XmlDictionaryReader.Create TextReader (bytes, XmlDictionaryReaderQuotas. Max);
what next, what do I do with the reader?
var bytes = Encoding.UTF8.GetBytes(the
var reader = XmlDictionaryReader.Create
what next, what do I do with the reader?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER