J
jens Jensen
Hello,
I need to call a webservice with an
System.Xml.XmlDocument objet and read the return value into and
System.Xml.XmlDocument. 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.Diagnostics;
using System.Web.Services;
using System.ComponentModel;
using System.Web.Services.Protocols;
using System;
using System.Xml.Serialization;
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services",
"2.0.50727.42")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Web.Services.WebServiceBindingAttribute(Name="ServiceSoap",
Namespace="http://tempuri.org/")]
public partial class Service :
System.Web.Services.Protocols.SoapHttpClientProtocol {
private System.Threading.SendOrPostCallback
processMessageOperationCompleted;
private bool useDefaultCredentialsSetExplicitly;
/// <remarks/>
public Service() {
this.Url =
global::testMyWebService.Properties.Settings.Default.testMyWebService_localhost_Service;
if ((this.IsLocalFileSystemWebService(this.Url) == true)) {
this.UseDefaultCredentials = true;
this.useDefaultCredentialsSetExplicitly = false;
}
else {
this.useDefaultCredentialsSetExplicitly = true;
}
}
public new string Url {
get {
return base.Url;
}
set {
if ((((this.IsLocalFileSystemWebService(base.Url) == true)
&& (this.useDefaultCredentialsSetExplicitly == false))
&& (this.IsLocalFileSystemWebService(value) == false))) {
base.UseDefaultCredentials = false;
}
base.Url = value;
}
}
public new bool UseDefaultCredentials {
get {
return base.UseDefaultCredentials;
}
set {
base.UseDefaultCredentials = value;
this.useDefaultCredentialsSetExplicitly = true;
}
}
/// <remarks/>
public event processMessageCompletedEventHandler processMessageCompleted;
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/processMessage",
RequestNamespace="http://tempuri.org/",
ResponseNamespace="http://tempuri.org/",
Use=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public System.Xml.XmlNode processMessage(System.Xml.XmlNode mes) {
object[] results = this.Invoke("processMessage", new object[] {
mes});
return ((System.Xml.XmlNode)(results[0]));
}
/// <remarks/>
public void processMessageAsync(System.Xml.XmlNode mes) {
this.processMessageAsync(mes, null);
}
/// <remarks/>
public void processMessageAsync(System.Xml.XmlNode mes, object userState) {
if ((this.processMessageOperationCompleted == null)) {
this.processMessageOperationCompleted = new
System.Threading.SendOrPostCallback(this.OnprocessMessageOperationCompleted);
}
this.InvokeAsync("processMessage", new object[] {
mes}, this.processMessageOperationCompleted, userState);
}
private void OnprocessMessageOperationCompleted(object arg) {
if ((this.processMessageCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs =
((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.processMessageCompleted(this, new
processMessageCompletedEventArgs(invokeArgs.Results, invokeArgs.Error,
invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
public new void CancelAsync(object userState) {
base.CancelAsync(userState);
}
private bool IsLocalFileSystemWebService(string 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.StringComparison.OrdinalIgnoreCase) == 0))) {
return true;
}
return false;
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services",
"2.0.50727.42")]
public delegate void processMessageCompletedEventHandler(object sender,
processMessageCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services",
"2.0.50727.42")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class processMessageCompletedEventArgs :
System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal processMessageCompletedEventArgs(object[] results, System.Exception
exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public System.Xml.XmlNode Result {
get {
this.RaiseExceptionIfNecessary();
return ((System.Xml.XmlNode)(this.results[0]));
}
}
}
}
How can i call this webservice with an
System.Xml.XmlDocument
and read the result with
System.Xml.XmlDocument
?
I'm using visual studio 2005.
Many thanks in advance
JJ
I need to call a webservice with an
System.Xml.XmlDocument objet and read the return value into and
System.Xml.XmlDocument. 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.Diagnostics;
using System.Web.Services;
using System.ComponentModel;
using System.Web.Services.Protocols;
using System;
using System.Xml.Serialization;
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services",
"2.0.50727.42")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Web.Services.WebServiceBindingAttribute(Name="ServiceSoap",
Namespace="http://tempuri.org/")]
public partial class Service :
System.Web.Services.Protocols.SoapHttpClientProtocol {
private System.Threading.SendOrPostCallback
processMessageOperationCompleted;
private bool useDefaultCredentialsSetExplicitly;
/// <remarks/>
public Service() {
this.Url =
global::testMyWebService.Properties.Settings.Default.testMyWebService_localhost_Service;
if ((this.IsLocalFileSystemWebService(this.Url) == true)) {
this.UseDefaultCredentials = true;
this.useDefaultCredentialsSetExplicitly = false;
}
else {
this.useDefaultCredentialsSetExplicitly = true;
}
}
public new string Url {
get {
return base.Url;
}
set {
if ((((this.IsLocalFileSystemWebService(base.Url) == true)
&& (this.useDefaultCredentialsSetExplicitly == false))
&& (this.IsLocalFileSystemWebService(value) == false))) {
base.UseDefaultCredentials = false;
}
base.Url = value;
}
}
public new bool UseDefaultCredentials {
get {
return base.UseDefaultCredentials;
}
set {
base.UseDefaultCredentials = value;
this.useDefaultCredentialsSetExplicitly = true;
}
}
/// <remarks/>
public event processMessageCompletedEventHandler processMessageCompleted;
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/processMessage",
RequestNamespace="http://tempuri.org/",
ResponseNamespace="http://tempuri.org/",
Use=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public System.Xml.XmlNode processMessage(System.Xml.XmlNode mes) {
object[] results = this.Invoke("processMessage", new object[] {
mes});
return ((System.Xml.XmlNode)(results[0]));
}
/// <remarks/>
public void processMessageAsync(System.Xml.XmlNode mes) {
this.processMessageAsync(mes, null);
}
/// <remarks/>
public void processMessageAsync(System.Xml.XmlNode mes, object userState) {
if ((this.processMessageOperationCompleted == null)) {
this.processMessageOperationCompleted = new
System.Threading.SendOrPostCallback(this.OnprocessMessageOperationCompleted);
}
this.InvokeAsync("processMessage", new object[] {
mes}, this.processMessageOperationCompleted, userState);
}
private void OnprocessMessageOperationCompleted(object arg) {
if ((this.processMessageCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs =
((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.processMessageCompleted(this, new
processMessageCompletedEventArgs(invokeArgs.Results, invokeArgs.Error,
invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
public new void CancelAsync(object userState) {
base.CancelAsync(userState);
}
private bool IsLocalFileSystemWebService(string 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.StringComparison.OrdinalIgnoreCase) == 0))) {
return true;
}
return false;
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services",
"2.0.50727.42")]
public delegate void processMessageCompletedEventHandler(object sender,
processMessageCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services",
"2.0.50727.42")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class processMessageCompletedEventArgs :
System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal processMessageCompletedEventArgs(object[] results, System.Exception
exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public System.Xml.XmlNode Result {
get {
this.RaiseExceptionIfNecessary();
return ((System.Xml.XmlNode)(this.results[0]));
}
}
}
}
How can i call this webservice with an
System.Xml.XmlDocument
and read the result with
System.Xml.XmlDocument
?
I'm using visual studio 2005.
Many thanks in advance
JJ