473,320 Members | 1,695 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

ASMX web service function reads incomplete XML

1
I wrote a simple web service function using ASMX:

Expand|Select|Wrap|Line Numbers
  1.     Public Function processMessage(ByVal Messages as XMLElement) As String         
  2.         Dim strS as string
  3.         strS = Messages.outerXML
  4.         Return strS
  5.     End Function
  6.  
This should is used to handle SOAP request like the following:
Expand|Select|Wrap|Line Numbers
  1. <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:urn="urn:gps-hex-communicator">
  2.    <soap:Header/>
  3.    <soap:Body>
  4.       <processMessage xmlns="urn:gps-hex-communicator">
  5.          <!--Optional:-->
  6.          <Messages>
  7.         <Message>
  8.             <DeviceID>5901</DeviceID>
  9.             <MessageID>201</MessageID>
  10.         </Message>
  11.         <Message>
  12.             <DeviceID>5902</DeviceID>
  13.             <MessageID>202</MessageID>
  14.         </Message>
  15.           </Messages>
  16.       </processMessage>
  17.    </soap:Body>
  18. </soap:Envelope>
  19.  
It seems only the first <Message> can be processed. Here's the response:

Expand|Select|Wrap|Line Numbers
  1. <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  2.    <soap:Body>
  3.       <processMessageResponse xmlns="urn:gps-hex-communicator">
  4.          <processMessageResult><![CDATA[<Message xmlns="urn:gps-hex-communicator">
  5.             <DeviceID>5901</DeviceID>
  6.             <MessageID>201</MessageID>
  7.         </Message>]]></processMessageResult>
  8.       </processMessageResponse>
  9.    </soap:Body>
  10. </soap:Envelope>
  11.  
Adding a dummy root in front of <Message> certainly can solve the problem. However the format of request is not allowed to be changed. Is there a simple way to read everything between the <Messages></Messages> tags?
Feb 15 '12 #1
0 1456

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Lubos | last post by:
Hi, When I create in VS2003 new WebApplication and then I add new file WebService1.asmx with function "login" in this application, how can I create new instance WebService1.login in my...
1
by: DraguVaso | last post by:
Hi, I want to create a Service that Reads and Write Files, and Insert and Select Data from a Sql Server Database. I did a little test with a small Service that I wanted to write something to...
1
by: JTrigger | last post by:
I need to call a .Net web service that takes an array or object as a parameter from a PERL client. I have been trying to use the PERL SOAP::Lite package to do this without success. I can call one...
1
by: Michael S. Scherotter | last post by:
I have a proxy class derived from System.Web.Services.Protocols.SoapHTTPClient that calls a web service. Sometimes, because the call takes a longer time, I get the OLE server busy dialog. Is...
0
by: Ji | last post by:
I have added a web reference to my pda applcation so that it can consume a small web service I wrote. When the pda app tries to call the web service function, a NotSupportedException is thrown. The...
0
by: sameem.samad | last post by:
Hi, I have a solution which has 3 layers - GUI, Interface Layer and web service layer. GUI layer is referencing Interface Layer and Web service layer also pointing to interface layer. GUI...
1
by: Tedmond | last post by:
Dear all, Is it possible to pass a DataTable as a parameter to a Web function? I have failed to do that. How? Thanks for any help! Tedmond
3
by: John K | last post by:
How do you hide the available functions (and syntax) that are normally displayed when you browse to a webservice (e.g. httpx://xxx.com/CMgr.asmx)? If you go to that page you will see a list of...
2
by: jiten | last post by:
Hi guys, I want to call a function of an application (Windowsapplication1.exe)from a windows service context menu (System Tray). 1. Through System.Reflection i try for but i get an error...
9
by: jsoques | last post by:
Hello, I created a Web Service using .Net 2.0 that has a function that returns a DataTable. I can test the function from the web page when I access the .asmx from a browser on localhost and it...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.