473,396 Members | 1,832 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,396 software developers and data experts.

Need to test a .Net dll using data that was sent to a WebService

Hi folks,

I have a WebService that simply acts as a thin wrapper to a .Net dll.

Literally almost zero code in the WebService.

Parameters passed to the WebService are simply used as parameters to
methods on the dll, and all parameters to my web methods are strings.
(The strings, just for further info, contain XML).

In the WebService by way of some diagnostic code I perform an
XmlDocument.Save() prior to calling my dll (to store the "string" in an
XML document), the theory being that I can then do an XmlDocument.Load()
on any file to diagnose a problem in my dll should a request to a
WebService fail. So far so good.. (well actually no)

Now here's the thing.. I had a client app (iexplorer) make a call the
WebService and that method failed, and on identifying which XML document
on my server failed, I loaded it up and tested my dll directly and it
worked. So obviously this means that some encoding issue between "being
sent over the wire from a browser" and "retreived as a string from a
file" is causing a discrepancy in testing since they're different input
parameters and are leading to different results. I know it is infact
this because when I do an XmlDocument.Load() in my WebService before
calling my dll so they have the SAME input data the dll also works from
the WebService. Argh.

So my question is: How can I test my WebService and DLL so that they
both use the same input data. How do I effectively test my dll so the
string I pass to a particular method is the string "as it was recieved
over the wire" by my WebService method.

Hope I've been clear?

Pebble
Sep 13 '06 #1
3 1881
"Pebble" <af***@23o.1f.co.ukwrote in message
news:ee***********@custnews.inweb.co.uk...
Hi folks,

I have a WebService that simply acts as a thin wrapper to a .Net dll.

Literally almost zero code in the WebService.

Parameters passed to the WebService are simply used as parameters to
methods on the dll, and all parameters to my web methods are strings.
(The strings, just for further info, contain XML).

In the WebService by way of some diagnostic code I perform an
XmlDocument.Save() prior to calling my dll (to store the "string" in an
XML document), the theory being that I can then do an XmlDocument.Load()
on any file to diagnose a problem in my dll should a request to a
WebService fail. So far so good.. (well actually no)

Now here's the thing.. I had a client app (iexplorer) make a call the
WebService and that method failed, and on identifying which XML document
on my server failed, I loaded it up and tested my dll directly and it
worked. So obviously this means that some encoding issue between "being
sent over the wire from a browser" and "retreived as a string from a
file" is causing a discrepancy in testing since they're different input
parameters and are leading to different results. I know it is infact
this because when I do an XmlDocument.Load() in my WebService before
calling my dll so they have the SAME input data the dll also works from
the WebService. Argh.
Unless you're validating your input parameters against a schema, or at least
testing them for being well-formed, I would not use XmlDocument.Save for
diagnostic purposes. Your clients are sending you strings which, if all is
well, will be well-formed XML. You should save them as strings, in case
there's something wrong with the input.

Doing this might show you what your problem is, as you won't have
XmlDocument intervening between what your web service receives and what your
DLL receives.

John
Sep 13 '06 #2
* John Saunders wrote:
Unless you're validating your input parameters against a schema, or at least
testing them for being well-formed, I would not use XmlDocument.Save for
diagnostic purposes. Your clients are sending you strings which, if all is
well, will be well-formed XML. You should save them as strings, in case
there's something wrong with the input.

Doing this might show you what your problem is, as you won't have
XmlDocument intervening between what your web service receives and what your
DLL receives.
So then I guess my question is how do I store a string so that when I
read it, I can be sure it is IDENTICAL to how it was PRIOR to storing it.
Sep 14 '06 #3
"Pebble" <af***@23o.1f.co.ukwrote in message
news:ee***********@custnews.inweb.co.uk...
>* John Saunders wrote:
>Unless you're validating your input parameters against a schema, or at
least
testing them for being well-formed, I would not use XmlDocument.Save for
diagnostic purposes. Your clients are sending you strings which, if all
is
well, will be well-formed XML. You should save them as strings, in case
there's something wrong with the input.

Doing this might show you what your problem is, as you won't have
XmlDocument intervening between what your web service receives and what
your
DLL receives.

So then I guess my question is how do I store a string so that when I
read it, I can be sure it is IDENTICAL to how it was PRIOR to storing it.
TextWriter.Write(string);
TextReader.Read(string);

This isn't difficult. You just need to remove any unnecessary layers between
the string and your code and the storage medium.

John
Sep 14 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Benne Smith | last post by:
Hi, I have three enviroments; a development, a testing and a production enviroment. I'm making a big application (.exe), which uses alot of different webservices. I don't use the webservices...
1
by: sujata shanbhag via .NET 247 | last post by:
Hi, I am using MSXML4.0 to call .NET Webservice from VB client. MyWebservice returs XML string. But if I use ResponseBody to readthe response sent by WebService, the '>' is converted to "&gt;"and '<'...
12
by: Noel | last post by:
Hello, I'm currently developing a web service that retrieves data from an employee table. I would like to send and retrieve a custom employee class to/from the webservice. I have currently coded...
0
by: Rene Ruppert | last post by:
Hi, On the web I found a simple sample/tutorial for a webservice, some kind of chat software. I implemented the server and the client. When I run the client form on the host PC everything works...
16
by: pamelafluente | last post by:
I am still working with no success on that client/server problem. I need your help. I will submit simplified versions of my problem so we can see clearly what is going on. My model: A client...
0
by: Joel | last post by:
This is the full background of my problem. I´m working with a client who connects to a secure webservice. I´m using VS 2003 .Net. with WSE 2.0 sp3 and the .Net 1.1 framework I got no access...
3
by: LW | last post by:
Hi! I am getting the following error message for my fairly simple web service. I have classes and have two DataSets that reference the same classes. The error is: The XML element named...
0
by: Jeova Almeida | last post by:
Hello, I created a simple web service for testing purpose in Visual Studio 2005: <%@ WebService Language="C#" CodeBehind="~/App_Code/Service.cs" Class="WSTest" %> using System;
6
by: smk17 | last post by:
I've spent the last few minutes searching for this question and I found an answer, but it wasn't quite what the client wanted. I have a simple online form where the user needs to fill out five...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.