Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

WCF client error: You are not allowed to call this method

7 views
Skip to first unread message

DomnicaAndone

unread,
Nov 13, 2009, 8:53:30 AM11/13/09
to
Hi,

I’m a newbie to WCF. I have to consume a third-party web-service (so I
have no source, no control over it, address is something like
https://aztdirect.allianztiriac.ro/SharedWebServices.Dev/QuotationManagementService.svc),
so I have to call it from a Visual Studio 2008 application (I work on
Windows XP SP3, .NET 3.5 Framework, C#).
I added a service reference from my app, visual studio created proxy
class and config file for me. I instantiated the proxy class but when
I try to call a service method, it gives me the FaultException: “You
are not allowed to call this method”.
OK, I said, errors happen, not big deal, but the big surprise was that
I cannot google it, it seems nobody ever got this error! Shouldn’t be
some classic error sent by the service or something? So I’m blocked,
please help me.

Here is the generated config file:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding
name="BasicHttpBinding_IQuotationManagementService"
closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00"
sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false"
hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536"
maxBufferPoolSize="524288"
maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8"
transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192"
maxArrayLength="16384"
maxBytesPerRead="4096"
maxNameTableCharCount="16384" />
<security mode="Transport">
<transport clientCredentialType="None"
proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="https://aztdirect.allianztiriac.ro/
SharedWebServices.Dev/QuotationManagementService.svc"
binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_IQuotationManagementService"
contract="AZT.NET.Insurance.Entities.Auto.IQuotationManagementService"
name="BasicHttpBinding_IQuotationManagementService" />
</client>
</system.serviceModel>
</configuration>

The vendor of the web-service confirmed to me that client credentials
are not needed to call the service.
Here is the code from my client:

private QuotationManagementServiceClient m_AllianzWS;
try
{
m_AllianzWS = new QuotationManagementServiceClient();
string rez = m_AllianzWS.CreateQuotationRco(“somedumbstring”);
}
catch (TimeoutException timeProblem)
{
Console.WriteLine("The service operation timed out. " +
timeProblem.Message);
m_AllianzWS.Abort();
}
catch (FaultException faultEx)
{
Console.WriteLine("An unknown exception was received. "
+ faultEx.Message
+ faultEx.StackTrace
);
m_AllianzWS.Abort();
}
// Standard communication fault handler.
catch (CommunicationException commProblem)
{
Console.WriteLine("There was a communication problem. " +
commProblem.Message + commProblem.StackTrace);
m_AllianzWS.Abort();
}
catch (Exception ex)
{
Console.WriteLine(“Classic exception: “ + ex.Message);
if (ex.InnerException != null)
Console.WriteLine(“Inner exception: “ +
ex.InnerException.Message);
}
finally
{
m_AllianzWS.Close();
}

0 new messages