Problems wlth SoapHttpClientProtocol

DeBuG

New member
Joined
Jun 24, 2003
Messages
2
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="urn:oasis:names:tc:SAML:1.0:protocol")]

public ResponseType SAMLRequest(
[XmlElement(Namespace="urn:oasis:names:tc:SAML:1.0:protocol")]
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.
 
You might want to look into using the WSDL utility for generating proxy classes; there is information on this utility in the MSDN. It may work better than just modifying code you found somewhere else.
 
Back
Top