Solved

SOAP .Net XML text file

Posted on 2014-01-21
6
1,142 Views
Last Modified: 2016-02-26
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 ?
0
Comment
Question by:rwallacej
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 

Author Comment

by:rwallacej
ID: 39798278
A better description might be how to "decode" to make a class with properties to match the XML
0
 

Author Comment

by:rwallacej
ID: 39798327
Or how to put the XML soap text into a "presentable" format as objects/vb classes for processing
0
 

Author Comment

by:rwallacej
ID: 39798396
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>
0
Give Your Engineering Team a Productivity Boost

Learn why container technology is so powerful and how it can provide your team with productivity gains and other benefits.

 
LVL 13

Expert Comment

by:Jitendra Patil
ID: 39799529
0
 

Author Comment

by:rwallacej
ID: 39800863
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?
0
 
LVL 13

Accepted Solution

by:
Jitendra Patil earned 500 total points
ID: 39802183
ok try the below way.

create a wsdl file of your xml SOAP response, please refer the below link for further information.
Web Services Description Language Tool

keep the wsdl file in C:\inetpub\wwwroot  folder, so that it will be up and running.

add a Web reference to your project and locate the service by the name you provide to your file.

add directive of the service and ready to go.

hope this helps.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here I am going to explain creating proxies at runtime for WCF Service. So basically we use to generate proxies using Add Service Reference and then giving the Url of the WCF service then generate proxy files at client side. Ok, what if something ge…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question