Solved

SOAP .Net XML text file

Posted on 2014-01-21
6
1,113 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
MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

 
LVL 12

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 12

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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

710 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