Im having problems implementing a class of type SoapHttpClientProtocol
my code is:
using System.Diagnostics;
using System.Xml.Serialization;
using System;
using System.Web.Services.Protocols;
using System.Web.Services.Description;
using System.ComponentModel;
using System.Web.Services;
using SourceId.Bindings.Saml.Protocol;
namespace SourceId.Bindings.Soap
{
/// <remarks/>
[DebuggerStepThrough()]
[DesignerCategory("code")]
[WebServiceBinding(Name="SAMLRequestSoapBinding",
Namespace="http://www.oasis-open.org/committees/security/docs/WSDLdefinitions.wsdl", Location="http://www.oasis-open.org/committees/security/docs/WSDLdefinitions.wsdl")]
[XmlInclude(typeof(ResponseAbstractType))]
[XmlInclude(typeof(RequestAbstractType))]
[XmlInclude(typeof(SourceId.Bindings.Liberty.Core.SignedSAMLRequestType))]
[XmlInclude(typeof(SourceId.Bindings.Liberty.Core.AssertionType1))]
[XmlInclude(typeof(SourceId.Bindings.Liberty.Core.AuthenticationStatementType1))]
[XmlInclude(typeof(SourceId.Bindings.Liberty.Core.SubjectType1))]
[XmlInclude(typeof(SourceId.Bindings.Liberty.Core.AuthnResponseType))]
public class SAMLRequestClient : SoapHttpClientProtocol
{
/// <remarks/>
public SAMLRequestClient(string url)
{
this.Url = url;
}
/// <remarks/>
[SoapDocumentMethod("",
Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Bare)]
[return: XmlElement("Response",
Namespace="urnasis:names:tc:SAML:1.0rotocol")]
public ResponseType SAMLRequest(
[XmlElement(Namespace="urnasis:names:tc:SAML:1.0rotocol")]
RequestAbstractType Request)
{
object[] results = this.Invoke(
"SAMLRequest", new object[] { Request } );
return ((ResponseType)(results[0]));
}
/// <remarks/>
public System.IAsyncResult BeginSAMLRequest(
RequestAbstractType Request,
System.AsyncCallback callback,
object asyncState)
{
return this.BeginInvoke(
"SAMLRequest", new object[] { Request }, callback, asyncState);
}
/// <remarks/>
public ResponseType EndSAMLRequest(System.IAsyncResult asyncResult)
{
object[] results = this.EndInvoke(asyncResult);
return ((ResponseType)(results[0]));
}
}
}
I think everything is correct but I get the message:
An exception occurred while trying to create an instance of System.Web.Services.Protocols.SoapHttpClientProtocol. The exception was "WebServiceBindingAttribute is required on proxy classes.".
The line:
[WebServiceBinding(Name="SAMLRequestSoapBinding",
Namespace="http://www.oasis-open.org/committees/security/docs/WSDLdefinitions.wsdl", Location="http://www.oasis-open.org/committees/security/docs/WSDLdefinitions.wsdl")]
Should solve this problem or not?
This code is from an open source project in www.sourceid.org.
my code is:
using System.Diagnostics;
using System.Xml.Serialization;
using System;
using System.Web.Services.Protocols;
using System.Web.Services.Description;
using System.ComponentModel;
using System.Web.Services;
using SourceId.Bindings.Saml.Protocol;
namespace SourceId.Bindings.Soap
{
/// <remarks/>
[DebuggerStepThrough()]
[DesignerCategory("code")]
[WebServiceBinding(Name="SAMLRequestSoapBinding",
Namespace="http://www.oasis-open.org/committees/security/docs/WSDLdefinitions.wsdl", Location="http://www.oasis-open.org/committees/security/docs/WSDLdefinitions.wsdl")]
[XmlInclude(typeof(ResponseAbstractType))]
[XmlInclude(typeof(RequestAbstractType))]
[XmlInclude(typeof(SourceId.Bindings.Liberty.Core.SignedSAMLRequestType))]
[XmlInclude(typeof(SourceId.Bindings.Liberty.Core.AssertionType1))]
[XmlInclude(typeof(SourceId.Bindings.Liberty.Core.AuthenticationStatementType1))]
[XmlInclude(typeof(SourceId.Bindings.Liberty.Core.SubjectType1))]
[XmlInclude(typeof(SourceId.Bindings.Liberty.Core.AuthnResponseType))]
public class SAMLRequestClient : SoapHttpClientProtocol
{
/// <remarks/>
public SAMLRequestClient(string url)
{
this.Url = url;
}
/// <remarks/>
[SoapDocumentMethod("",
Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Bare)]
[return: XmlElement("Response",
Namespace="urnasis:names:tc:SAML:1.0rotocol")]
public ResponseType SAMLRequest(
[XmlElement(Namespace="urnasis:names:tc:SAML:1.0rotocol")]
RequestAbstractType Request)
{
object[] results = this.Invoke(
"SAMLRequest", new object[] { Request } );
return ((ResponseType)(results[0]));
}
/// <remarks/>
public System.IAsyncResult BeginSAMLRequest(
RequestAbstractType Request,
System.AsyncCallback callback,
object asyncState)
{
return this.BeginInvoke(
"SAMLRequest", new object[] { Request }, callback, asyncState);
}
/// <remarks/>
public ResponseType EndSAMLRequest(System.IAsyncResult asyncResult)
{
object[] results = this.EndInvoke(asyncResult);
return ((ResponseType)(results[0]));
}
}
}
I think everything is correct but I get the message:
An exception occurred while trying to create an instance of System.Web.Services.Protocols.SoapHttpClientProtocol. The exception was "WebServiceBindingAttribute is required on proxy classes.".
The line:
[WebServiceBinding(Name="SAMLRequestSoapBinding",
Namespace="http://www.oasis-open.org/committees/security/docs/WSDLdefinitions.wsdl", Location="http://www.oasis-open.org/committees/security/docs/WSDLdefinitions.wsdl")]
Should solve this problem or not?
This code is from an open source project in www.sourceid.org.