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
Comment