Question about web service which execute javawebservices from .net client.

A

Anil S

Hello,

my application is console application and I have created "Service Reference" of the webservices. this webservice uses username and password. my code are following:

myArray[] nl;

FeedSoapClient client = new FeedSoapClient();
client.ClientCredentials.UserName.UserName = "tellme";
client.ClientCredentials.UserName.Password = "tellme";


nl = client.getCustInfo();
int i = 0;
while (i <= (nl.Length - 1))
{
Console.WriteLine(nl.name + " " + nl.address);
i++;
}


ERROR which I am getting, is this:

System.Configuration.ConfigurationErrorsException: The value of the property 'cl
ientCredentialType' cannot be parsed. The error is: The enumeration value must b
e one of the following: None, Basic, Digest, Ntlm, Windows, Certificate. (C:\Use
rs\localhost\Documents\Visual Studio 2008\Projects\RetrieveRTDataFromNYISO\Retri
eveRTDataFromNYISO\bin\Debug\RetrieveRTDataFromNYISO.exe.Config line 28)
at System.Configuration.BaseConfigurationRecord.EvaluateOne(String[] keys, Se
ctionInput input, Boolean isTrusted, FactoryRecord factoryRecord, SectionRecord
sectionRecord, Object parentResult)
at System.Configuration.BaseConfigurationRecord.Evaluate(FactoryRecord factor
yRecord, SectionRecord sectionRecord, Object parentResult, Boolean getLkg, Boole
an getRuntimeObject, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String co
nfigKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Bool
ean requestIsHere, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String co
nfigKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Bool
ean requestIsHere, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String co
nfigKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Bool
ean requestIsHere, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSection(String configKey,
Boolean getLkg, Boolean checkPermission)
at System.Configuration.BaseConfigurationRecord.GetSection(String configKey)
at System.Configuration.ClientConfigurationSystem.System.Configuration.Intern
al.IInternalConfigSystem.GetSection(String sectionName)
at System.Configuration.ConfigurationManager.GetSection(String sectionName)
at System.ServiceModel.Configuration.ConfigurationHelpers.UnsafeGetSectionFro
mConfigurationManager(String sectionPath)
at System.ServiceModel.Configuration.ConfigurationHelpers.UnsafeGetAssociated
Section(ContextInformation evalContext, String sectionPath)
at System.ServiceModel.Configuration.ClientSection.UnsafeGetSection()
at System.ServiceModel.Description.ConfigLoader.LookupChannel(String configur
ationName, String contractName, Boolean wildcard)
at System.ServiceModel.Description.ConfigLoader.LoadChannelBehaviors(ServiceE
ndpoint serviceEndpoint, String configurationName)
at System.ServiceModel.ChannelFactory.ApplyConfiguration(String configuration
Name)
at System.ServiceModel.ChannelFactory.InitializeEndpoint(String configuration
Name, EndpointAddress address)
at System.ServiceModel.ChannelFactory`1..ctor(String endpointConfigurationNam
e, EndpointAddress remoteAddress)
at System.ServiceModel.EndpointTrait`1.CreateSimplexFactory()
at System.ServiceModel.EndpointTrait`1.CreateChannelFactory()
at System.ServiceModel.ClientBase`1.CreateChannelFactoryRef(EndpointTrait`1 e
ndpointTrait)
at System.ServiceModel.ClientBase`1.InitializeChannelFactoryRef()
at System.ServiceModel.ClientBase`1..ctor()
at RetrieveRTDataFromNYISO.ServiceReference.eDataFeedSoapClient..ctor() in C:
\Users\localhost\Documents\Visual Studio 2008\Projects\RetrieveRTDataFromNYISO\R
etrieveRTDataFromNYISO\Service References\ServiceReference\Reference.cs:line 154
5
at RetrieveRTDataFromNYISO.Program.Main() in C:\Users\localhost\Documents\Vis
ual Studio 2008\Projects\RetrieveRTDataFromNYISO\RetrieveRTDataFromNYISO\Program
..cs:line 26


can you tell me how to fix this problem? According to me, it is not accepting the username and password.
 
C

Cowboy \(Gregory A. Beamer\)

It is not so much a refusal as not setting a credential type at all. After
you solve this, I bet you start to uncover other issues.

Unfortunately, there is only one book out there on C# and Java with web
services (or one that I know of that targets that topic) and it is not that
good.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://feeds.feedburner.com/GregoryBeamer#

or just read it:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think outside the box! |
********************************************
Hello,

my application is console application and I have created "Service
Reference" of the webservices. this webservice uses username and password.
my code are following:

myArray[] nl;

FeedSoapClient client = new FeedSoapClient();
client.ClientCredentials.UserName.UserName = "tellme";
client.ClientCredentials.UserName.Password = "tellme";


nl = client.getCustInfo();
int i = 0;
while (i <= (nl.Length - 1))
{
Console.WriteLine(nl.name + " " + nl.address);
i++;
}


ERROR which I am getting, is this:

System.Configuration.ConfigurationErrorsException: The value of the
property 'cl
ientCredentialType' cannot be parsed. The error is: The enumeration value
must b
e one of the following: None, Basic, Digest, Ntlm, Windows, Certificate.
(C:\Use
rs\localhost\Documents\Visual Studio
2008\Projects\RetrieveRTDataFromNYISO\Retri
eveRTDataFromNYISO\bin\Debug\RetrieveRTDataFromNYISO.exe.Config line 28)
at System.Configuration.BaseConfigurationRecord.EvaluateOne(String[]
keys, Se
ctionInput input, Boolean isTrusted, FactoryRecord factoryRecord,
SectionRecord
sectionRecord, Object parentResult)
at System.Configuration.BaseConfigurationRecord.Evaluate(FactoryRecord
factor
yRecord, SectionRecord sectionRecord, Object parentResult, Boolean getLkg,
Boole
an getRuntimeObject, Object& result, Object& resultRuntimeObject)
at
System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String co
nfigKey, Boolean getLkg, Boolean checkPermission, Boolean
getRuntimeObject, Bool
ean requestIsHere, Object& result, Object& resultRuntimeObject)
at
System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String co
nfigKey, Boolean getLkg, Boolean checkPermission, Boolean
getRuntimeObject, Bool
ean requestIsHere, Object& result, Object& resultRuntimeObject)
at
System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String co
nfigKey, Boolean getLkg, Boolean checkPermission, Boolean
getRuntimeObject, Bool
ean requestIsHere, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSection(String
configKey,
Boolean getLkg, Boolean checkPermission)
at System.Configuration.BaseConfigurationRecord.GetSection(String
configKey)
at
System.Configuration.ClientConfigurationSystem.System.Configuration.Intern
al.IInternalConfigSystem.GetSection(String sectionName)
at System.Configuration.ConfigurationManager.GetSection(String
sectionName)
at
System.ServiceModel.Configuration.ConfigurationHelpers.UnsafeGetSectionFro
mConfigurationManager(String sectionPath)
at
System.ServiceModel.Configuration.ConfigurationHelpers.UnsafeGetAssociated
Section(ContextInformation evalContext, String sectionPath)
at System.ServiceModel.Configuration.ClientSection.UnsafeGetSection()
at System.ServiceModel.Description.ConfigLoader.LookupChannel(String
configur
ationName, String contractName, Boolean wildcard)
at
System.ServiceModel.Description.ConfigLoader.LoadChannelBehaviors(ServiceE
ndpoint serviceEndpoint, String configurationName)
at System.ServiceModel.ChannelFactory.ApplyConfiguration(String
configuration
Name)
at System.ServiceModel.ChannelFactory.InitializeEndpoint(String
configuration
Name, EndpointAddress address)
at System.ServiceModel.ChannelFactory`1..ctor(String
endpointConfigurationNam
e, EndpointAddress remoteAddress)
at System.ServiceModel.EndpointTrait`1.CreateSimplexFactory()
at System.ServiceModel.EndpointTrait`1.CreateChannelFactory()
at
System.ServiceModel.ClientBase`1.CreateChannelFactoryRef(EndpointTrait`1 e
ndpointTrait)
at System.ServiceModel.ClientBase`1.InitializeChannelFactoryRef()
at System.ServiceModel.ClientBase`1..ctor()
at RetrieveRTDataFromNYISO.ServiceReference.eDataFeedSoapClient..ctor()
in C:
\Users\localhost\Documents\Visual Studio
2008\Projects\RetrieveRTDataFromNYISO\R
etrieveRTDataFromNYISO\Service
References\ServiceReference\Reference.cs:line 154
5
at RetrieveRTDataFromNYISO.Program.Main() in
C:\Users\localhost\Documents\Vis
ual Studio
2008\Projects\RetrieveRTDataFromNYISO\RetrieveRTDataFromNYISO\Program
.cs:line 26


can you tell me how to fix this problem? According to me, it is not
accepting the username and password.
 
A

Anil S

<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="eFeedSoap" 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="Basic" proxyCredentialType="Basic" realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="https://efeed.test.com/efeed/eFeed.jws?WSDL="
binding="basicHttpBinding" bindingConfiguration="eFeedSoap"
contract="ServiceReference.eFeedSoap" name="eFeedSoap" />
</client>

</system.serviceModel>
 
A

Anil S

<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="eFeedSoap" 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="Basic" proxyCredentialType="Basic" realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="https://efeed.test.com:443/efeed/eFeed.jws?WSDL="
binding="basicHttpBinding" bindingConfiguration="eFeedSoap"
contract="ServiceReference.eFeedSoap" name="eFeedSoap" />
</client>

</system.serviceModel>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top