473,799 Members | 3,121 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Webservice trouble!


Hello,
I need to call a webservice with an
System.Xml.XmlD ocument objet and read the return value into and

System.Xml.XmlD ocument. The webservice was written with an oracle tool and
wrapped into a .net webservice.

I have added a reference to my dotnet wrapper and i get the following
refrence file:
using System.Diagnost ics;

using System.Web.Serv ices;

using System.Componen tModel;

using System.Web.Serv ices.Protocols;

using System;

using System.Xml.Seri alization;

/// <remarks/>

[System.CodeDom. Compiler.Genera tedCodeAttribut e("System.Web.S ervices",
"2.0.50727. 42")]

[System.Diagnost ics.DebuggerSte pThroughAttribu te()]

[System.Componen tModel.Designer CategoryAttribu te("code")]

[System.Web.Serv ices.WebService BindingAttribut e(Name="Service Soap",
Namespace="http ://tempuri.org/")]

public partial class Service :
System.Web.Serv ices.Protocols. SoapHttpClientP rotocol {
private System.Threadin g.SendOrPostCal lback
processMessageO perationComplet ed;
private bool useDefaultCrede ntialsSetExplic itly;
/// <remarks/>

public Service() {

this.Url =
global::testMyW ebService.Prope rties.Settings. Default.testMyW ebService_local host_Service;

if ((this.IsLocalF ileSystemWebSer vice(this.Url) == true)) {

this.UseDefault Credentials = true;

this.useDefault CredentialsSetE xplicitly = false;

}

else {

this.useDefault CredentialsSetE xplicitly = true;

}

}
public new string Url {

get {

return base.Url;

}

set {

if ((((this.IsLoca lFileSystemWebS ervice(base.Url ) == true)

&& (this.useDefaul tCredentialsSet Explicitly == false))

&& (this.IsLocalFi leSystemWebServ ice(value) == false))) {

base.UseDefault Credentials = false;

}

base.Url = value;

}

}
public new bool UseDefaultCrede ntials {

get {

return base.UseDefault Credentials;

}

set {

base.UseDefault Credentials = value;

this.useDefault CredentialsSetE xplicitly = true;

}

}
/// <remarks/>

public event processMessageC ompletedEventHa ndler processMessageC ompleted;
/// <remarks/>

[System.Web.Serv ices.Protocols. SoapDocumentMet hodAttribute("h ttp://tempuri.org/processMessage" ,
RequestNamespac e="http://tempuri.org/",
ResponseNamespa ce="http://tempuri.org/",
Use=System.Web. Services.Descri ption.SoapBindi ngUse.Literal,
ParameterStyle= System.Web.Serv ices.Protocols. SoapParameterSt yle.Wrapped)]

public System.Xml.XmlN ode processMessage( System.Xml.XmlN ode mes) {

object[] results = this.Invoke("pr ocessMessage", new object[] {

mes});

return ((System.Xml.Xm lNode)(results[0]));

}
/// <remarks/>

public void processMessageA sync(System.Xml .XmlNode mes) {

this.processMes sageAsync(mes, null);

}
/// <remarks/>

public void processMessageA sync(System.Xml .XmlNode mes, object userState) {

if ((this.processM essageOperation Completed == null)) {

this.processMes sageOperationCo mpleted = new
System.Threadin g.SendOrPostCal lback(this.Onpr ocessMessageOpe rationCompleted );

}

this.InvokeAsyn c("processMessa ge", new object[] {

mes}, this.processMes sageOperationCo mpleted, userState);

}
private void OnprocessMessag eOperationCompl eted(object arg) {

if ((this.processM essageCompleted != null)) {

System.Web.Serv ices.Protocols. InvokeCompleted EventArgs invokeArgs =
((System.Web.Se rvices.Protocol s.InvokeComplet edEventArgs)(ar g));

this.processMes sageCompleted(t his, new
processMessageC ompletedEventAr gs(invokeArgs.R esults, invokeArgs.Erro r,
invokeArgs.Canc elled, invokeArgs.User State));

}

}
/// <remarks/>

public new void CancelAsync(obj ect userState) {

base.CancelAsyn c(userState);

}
private bool IsLocalFileSyst emWebService(st ring url) {

if (((url == null)

|| (url == string.Empty))) {

return false;

}

System.Uri wsUri = new System.Uri(url) ;

if (((wsUri.Port >= 1024)

&& (string.Compare (wsUri.Host, "localHost" ,
System.StringCo mparison.Ordina lIgnoreCase) == 0))) {

return true;

}

return false;

}

}
/// <remarks/>

[System.CodeDom. Compiler.Genera tedCodeAttribut e("System.Web.S ervices",
"2.0.50727. 42")]

public delegate void processMessageC ompletedEventHa ndler(object sender,
processMessageC ompletedEventAr gs e);
/// <remarks/>

[System.CodeDom. Compiler.Genera tedCodeAttribut e("System.Web.S ervices",
"2.0.50727. 42")]

[System.Diagnost ics.DebuggerSte pThroughAttribu te()]

[System.Componen tModel.Designer CategoryAttribu te("code")]

public partial class processMessageC ompletedEventAr gs :
System.Componen tModel.AsyncCom pletedEventArgs {
private object[] results;
internal processMessageC ompletedEventAr gs(object[] results, System.Exceptio n
exception, bool cancelled, object userState) :

base(exception, cancelled, userState) {

this.results = results;

}
/// <remarks/>

public System.Xml.XmlN ode Result {

get {

this.RaiseExcep tionIfNecessary ();

return ((System.Xml.Xm lNode)(this.res ults[0]));

}

}

}

}

How can i call this webservice with an

System.Xml.XmlD ocument

and read the result with

System.Xml.XmlD ocument

?

I'm using visual studio 2005.

Many thanks in advance

JJ
Feb 15 '06 #1
4 6254
JJ,
I have noticed that attempting to return an XmlDocument from an ASP.NET
Webservice usually results in getting an XmlNode. So you can try getting the
result of the WebService Call as XmlNode, and if you really require a
complete XmlDocument, just add the Node to a new instance of XmlDocument.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"jens Jensen" wrote:

Hello,
I need to call a webservice with an
System.Xml.XmlD ocument objet and read the return value into and

System.Xml.XmlD ocument. The webservice was written with an oracle tool and
wrapped into a .net webservice.

I have added a reference to my dotnet wrapper and i get the following
refrence file:
using System.Diagnost ics;

using System.Web.Serv ices;

using System.Componen tModel;

using System.Web.Serv ices.Protocols;

using System;

using System.Xml.Seri alization;

/// <remarks/>

[System.CodeDom. Compiler.Genera tedCodeAttribut e("System.Web.S ervices",
"2.0.50727. 42")]

[System.Diagnost ics.DebuggerSte pThroughAttribu te()]

[System.Componen tModel.Designer CategoryAttribu te("code")]

[System.Web.Serv ices.WebService BindingAttribut e(Name="Service Soap",
Namespace="http ://tempuri.org/")]

public partial class Service :
System.Web.Serv ices.Protocols. SoapHttpClientP rotocol {
private System.Threadin g.SendOrPostCal lback
processMessageO perationComplet ed;
private bool useDefaultCrede ntialsSetExplic itly;
/// <remarks/>

public Service() {

this.Url =
global::testMyW ebService.Prope rties.Settings. Default.testMyW ebService_local host_Service;

if ((this.IsLocalF ileSystemWebSer vice(this.Url) == true)) {

this.UseDefault Credentials = true;

this.useDefault CredentialsSetE xplicitly = false;

}

else {

this.useDefault CredentialsSetE xplicitly = true;

}

}
public new string Url {

get {

return base.Url;

}

set {

if ((((this.IsLoca lFileSystemWebS ervice(base.Url ) == true)

&& (this.useDefaul tCredentialsSet Explicitly == false))

&& (this.IsLocalFi leSystemWebServ ice(value) == false))) {

base.UseDefault Credentials = false;

}

base.Url = value;

}

}
public new bool UseDefaultCrede ntials {

get {

return base.UseDefault Credentials;

}

set {

base.UseDefault Credentials = value;

this.useDefault CredentialsSetE xplicitly = true;

}

}
/// <remarks/>

public event processMessageC ompletedEventHa ndler processMessageC ompleted;
/// <remarks/>

[System.Web.Serv ices.Protocols. SoapDocumentMet hodAttribute("h ttp://tempuri.org/processMessage" ,
RequestNamespac e="http://tempuri.org/",
ResponseNamespa ce="http://tempuri.org/",
Use=System.Web. Services.Descri ption.SoapBindi ngUse.Literal,
ParameterStyle= System.Web.Serv ices.Protocols. SoapParameterSt yle.Wrapped)]

public System.Xml.XmlN ode processMessage( System.Xml.XmlN ode mes) {

object[] results = this.Invoke("pr ocessMessage", new object[] {

mes});

return ((System.Xml.Xm lNode)(results[0]));

}
/// <remarks/>

public void processMessageA sync(System.Xml .XmlNode mes) {

this.processMes sageAsync(mes, null);

}
/// <remarks/>

public void processMessageA sync(System.Xml .XmlNode mes, object userState) {

if ((this.processM essageOperation Completed == null)) {

this.processMes sageOperationCo mpleted = new
System.Threadin g.SendOrPostCal lback(this.Onpr ocessMessageOpe rationCompleted );

}

this.InvokeAsyn c("processMessa ge", new object[] {

mes}, this.processMes sageOperationCo mpleted, userState);

}
private void OnprocessMessag eOperationCompl eted(object arg) {

if ((this.processM essageCompleted != null)) {

System.Web.Serv ices.Protocols. InvokeCompleted EventArgs invokeArgs =
((System.Web.Se rvices.Protocol s.InvokeComplet edEventArgs)(ar g));

this.processMes sageCompleted(t his, new
processMessageC ompletedEventAr gs(invokeArgs.R esults, invokeArgs.Erro r,
invokeArgs.Canc elled, invokeArgs.User State));

}

}
/// <remarks/>

public new void CancelAsync(obj ect userState) {

base.CancelAsyn c(userState);

}
private bool IsLocalFileSyst emWebService(st ring url) {

if (((url == null)

|| (url == string.Empty))) {

return false;

}

System.Uri wsUri = new System.Uri(url) ;

if (((wsUri.Port >= 1024)

&& (string.Compare (wsUri.Host, "localHost" ,
System.StringCo mparison.Ordina lIgnoreCase) == 0))) {

return true;

}

return false;

}

}
/// <remarks/>

[System.CodeDom. Compiler.Genera tedCodeAttribut e("System.Web.S ervices",
"2.0.50727. 42")]

public delegate void processMessageC ompletedEventHa ndler(object sender,
processMessageC ompletedEventAr gs e);
/// <remarks/>

[System.CodeDom. Compiler.Genera tedCodeAttribut e("System.Web.S ervices",
"2.0.50727. 42")]

[System.Diagnost ics.DebuggerSte pThroughAttribu te()]

[System.Componen tModel.Designer CategoryAttribu te("code")]

public partial class processMessageC ompletedEventAr gs :
System.Componen tModel.AsyncCom pletedEventArgs {
private object[] results;
internal processMessageC ompletedEventAr gs(object[] results, System.Exceptio n
exception, bool cancelled, object userState) :

base(exception, cancelled, userState) {

this.results = results;

}
/// <remarks/>

public System.Xml.XmlN ode Result {

get {

this.RaiseExcep tionIfNecessary ();

return ((System.Xml.Xm lNode)(this.res ults[0]));

}

}

}

}

How can i call this webservice with an

System.Xml.XmlD ocument

and read the result with

System.Xml.XmlD ocument

?

I'm using visual studio 2005.

Many thanks in advance

JJ

Feb 15 '06 #2
Many thanks Peter,
Well i was very unsure how to go from XmlNode to XmlDocument.
I have now been through a couple msdn pages and it now makes more sens to me
thanks to your posting.

JJ

"Peter Bromberg [C# MVP]" <pb*******@yaho o.nospammin.com > skrev i en
meddelelse news:29******** *************** ***********@mic rosoft.com...
JJ,
I have noticed that attempting to return an XmlDocument from an ASP.NET
Webservice usually results in getting an XmlNode. So you can try getting
the
result of the WebService Call as XmlNode, and if you really require a
complete XmlDocument, just add the Node to a new instance of XmlDocument.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"jens Jensen" wrote:

Hello,
I need to call a webservice with an
System.Xml.XmlD ocument objet and read the return value into and

System.Xml.XmlD ocument. The webservice was written with an oracle tool
and
wrapped into a .net webservice.

I have added a reference to my dotnet wrapper and i get the following
refrence file:
using System.Diagnost ics;

using System.Web.Serv ices;

using System.Componen tModel;

using System.Web.Serv ices.Protocols;

using System;

using System.Xml.Seri alization;

/// <remarks/>

[System.CodeDom. Compiler.Genera tedCodeAttribut e("System.Web.S ervices",
"2.0.50727. 42")]

[System.Diagnost ics.DebuggerSte pThroughAttribu te()]

[System.Componen tModel.Designer CategoryAttribu te("code")]

[System.Web.Serv ices.WebService BindingAttribut e(Name="Service Soap",
Namespace="http ://tempuri.org/")]

public partial class Service :
System.Web.Serv ices.Protocols. SoapHttpClientP rotocol {
private System.Threadin g.SendOrPostCal lback
processMessageO perationComplet ed;
private bool useDefaultCrede ntialsSetExplic itly;
/// <remarks/>

public Service() {

this.Url =
global::testMyW ebService.Prope rties.Settings. Default.testMyW ebService_local host_Service;

if ((this.IsLocalF ileSystemWebSer vice(this.Url) == true)) {

this.UseDefault Credentials = true;

this.useDefault CredentialsSetE xplicitly = false;

}

else {

this.useDefault CredentialsSetE xplicitly = true;

}

}
public new string Url {

get {

return base.Url;

}

set {

if ((((this.IsLoca lFileSystemWebS ervice(base.Url ) == true)

&& (this.useDefaul tCredentialsSet Explicitly == false))

&& (this.IsLocalFi leSystemWebServ ice(value) == false))) {

base.UseDefault Credentials = false;

}

base.Url = value;

}

}
public new bool UseDefaultCrede ntials {

get {

return base.UseDefault Credentials;

}

set {

base.UseDefault Credentials = value;

this.useDefault CredentialsSetE xplicitly = true;

}

}
/// <remarks/>

public event processMessageC ompletedEventHa ndler processMessageC ompleted;
/// <remarks/>

[System.Web.Serv ices.Protocols. SoapDocumentMet hodAttribute("h ttp://tempuri.org/processMessage" ,
RequestNamespac e="http://tempuri.org/",
ResponseNamespa ce="http://tempuri.org/",
Use=System.Web. Services.Descri ption.SoapBindi ngUse.Literal,
ParameterStyle= System.Web.Serv ices.Protocols. SoapParameterSt yle.Wrapped)]

public System.Xml.XmlN ode processMessage( System.Xml.XmlN ode mes) {

object[] results = this.Invoke("pr ocessMessage", new object[] {

mes});

return ((System.Xml.Xm lNode)(results[0]));

}
/// <remarks/>

public void processMessageA sync(System.Xml .XmlNode mes) {

this.processMes sageAsync(mes, null);

}
/// <remarks/>

public void processMessageA sync(System.Xml .XmlNode mes, object userState)
{

if ((this.processM essageOperation Completed == null)) {

this.processMes sageOperationCo mpleted = new
System.Threadin g.SendOrPostCal lback(this.Onpr ocessMessageOpe rationCompleted );

}

this.InvokeAsyn c("processMessa ge", new object[] {

mes}, this.processMes sageOperationCo mpleted, userState);

}
private void OnprocessMessag eOperationCompl eted(object arg) {

if ((this.processM essageCompleted != null)) {

System.Web.Serv ices.Protocols. InvokeCompleted EventArgs invokeArgs =
((System.Web.Se rvices.Protocol s.InvokeComplet edEventArgs)(ar g));

this.processMes sageCompleted(t his, new
processMessageC ompletedEventAr gs(invokeArgs.R esults, invokeArgs.Erro r,
invokeArgs.Canc elled, invokeArgs.User State));

}

}
/// <remarks/>

public new void CancelAsync(obj ect userState) {

base.CancelAsyn c(userState);

}
private bool IsLocalFileSyst emWebService(st ring url) {

if (((url == null)

|| (url == string.Empty))) {

return false;

}

System.Uri wsUri = new System.Uri(url) ;

if (((wsUri.Port >= 1024)

&& (string.Compare (wsUri.Host, "localHost" ,
System.StringCo mparison.Ordina lIgnoreCase) == 0))) {

return true;

}

return false;

}

}
/// <remarks/>

[System.CodeDom. Compiler.Genera tedCodeAttribut e("System.Web.S ervices",
"2.0.50727. 42")]

public delegate void processMessageC ompletedEventHa ndler(object sender,
processMessageC ompletedEventAr gs e);
/// <remarks/>

[System.CodeDom. Compiler.Genera tedCodeAttribut e("System.Web.S ervices",
"2.0.50727. 42")]

[System.Diagnost ics.DebuggerSte pThroughAttribu te()]

[System.Componen tModel.Designer CategoryAttribu te("code")]

public partial class processMessageC ompletedEventAr gs :
System.Componen tModel.AsyncCom pletedEventArgs {
private object[] results;
internal processMessageC ompletedEventAr gs(object[] results,
System.Exceptio n
exception, bool cancelled, object userState) :

base(exception, cancelled, userState) {

this.results = results;

}
/// <remarks/>

public System.Xml.XmlN ode Result {

get {

this.RaiseExcep tionIfNecessary ();

return ((System.Xml.Xm lNode)(this.res ults[0]));

}

}

}

}

How can i call this webservice with an

System.Xml.XmlD ocument

and read the result with

System.Xml.XmlD ocument

?

I'm using visual studio 2005.

Many thanks in advance

JJ

Feb 16 '06 #3
Hi Peter,
Could you please give a code example. I understand the idea but i haven't
found the right code yet.
Many thanks in advance
JJ
Feb 16 '06 #4
This is where I learned how to do it:

http://msdn.microsoft.com/library/de...tnodetopic.asp

Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"jens Jensen" wrote:
Hi Peter,
Could you please give a code example. I understand the idea but i haven't
found the right code yet.
Many thanks in advance
JJ

Feb 16 '06 #5

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

Similar topics

1
2477
by: James A. Donald | last post by:
I have an application, which needs to be rewritten into a webservice. The application is in C++, and my background is writing stuff for IIS in C++ and microsoft's javascript, but my intended customers are not going to pay for IIS, and many of them would not know how to manage IIS, though it is a lot easier than managing apache. So I guess I should write the logon and user interface in JSP under Tomcat/Jakarta, (which I have never used...
1
1228
by: Ricky K. Rasmussen | last post by:
Hi NG, When connecting to a local WebService one of our customers gets a very strange exception: "File or assembly name gaw9eaqv.dll, or one of its dependencies, was not found." The strange part is that the name of the assembly can vary, and has nothing to do with the names of the assemblies used in neither the WebService or the
0
1126
by: Helios | last post by:
Hello there, I'm new to webservices and have trouble getting started. I've got to develope a webservice which receives messages and in response to each message sends a response back. The webservice has to conform to a given wsdl provided to me. I've searched different articles and found many of them describing how to use a wsdl to consume a webservice by generating proxy classes but not one about how do i built a webservice which...
1
1215
by: Jensen Bredal | last post by:
Hello, I have written a very simple web service with only one "web method". The web method does what it is supposed to do when invoked locally but fails one invoked remotelly with http error 500. Any idea what i have done wrong?
2
1578
by: Helbi | last post by:
Hi, i 've got some troubles with a webservice. I created it in local, and tested it also in local. My trouble come from putting the webservice on an other computer, ant trying to use it (normal using). the error is (in french): Une exception non gérée du type 'System.IO.IOException' s'est produite dans system.dll Informations supplémentaires : Impossible de lire les données de la connexion de transport.
0
1083
by: S. Berwanger | last post by:
Hallo, I'm trouble debugging a Webservice application on the WinCE 4.1 emulator from VS 2003. The Webservice gives back Datasets from a SQL Database. When I'm starting the application for the first time everything works fine. Later I can exist the application without a problems and returns to VS as expected. But the second start hangs ("Anwendung wird gestartet" - Application launching is the last message).
3
5006
by: Olivier BESSON | last post by:
Hello, I have a web service of my own on a server (vb.net). I must declare it with SoapRpcMethod to be used with JAVA. This is a simple exemple method of my vb source : >************************************************************************ > <WebMethod(), System.Web.Services.Protocols.SoapRpcMethod()> _ > Public Function HelloWorld() As > <System.Xml.Serialization.SoapElementAttribute("return")> String
0
1233
by: Eric bouxirot | last post by:
hi, i have some trouble to debug my webservice i have a server with SBS2003 (with domain controler) with IIS 6 my dev machine is XP Pro on WorkGroup with VS2005 if i run webservice and client application on my dev computer, all work fine...
2
4978
by: Jeff | last post by:
hi VS2008 I have trouble getting the AutoCompleteExtender to work. I've seen the video at http://www.asp.net:80/learn/ajax-videos/video-122.aspx but don't understand what I do wrong. I've even downloaded the source code next to the video and cannot see what I do wrong here. When I run the .aspx webpage, I start typing in the textbox but isn't called after I've typed in 3 chars. I know
0
9538
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10247
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10214
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10023
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9067
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7561
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5583
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4135
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3751
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.