CipherIS
asked on
ASP.NET - Issue with WCF Service in website
I developed a WCF Service. I enter URL HTTPS://myserver/myservice/service.svc and I receive the WSDL. I then add service reference and the website finds it and adds it successfully. Running the code the below has no issues.
ITransferService APILogin = new TransferServiceClient();
However, when I run the below code
foreach (var results in APILogin.ILogin(this.txtUs erName.Tex t.ToString (),
this.txtPassword.Text.ToSt ring()))
I receive the below error
The provided URI scheme 'https' is invalid; expected 'http'.
Parameter name: via
I'm using basicHTTPBinding. Below is what is in my web.config file.
<binding name="BasicHttpBinding_IMD RTransferS ervice1" closeTimeout="04:01:00"
openTimeout="04:01:00" receiveTimeout="04:10:00" sendTimeout="04:01:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="St rongWildca rd"
maxBufferSize="2147483647" maxBufferPoolSize="2147483 647" maxReceivedMessageSize="21 47483647"
messageEncoding="Text" textEncoding="utf-8" transferMode="StreamedRequ est"
useDefaultWebProxy="true">
<readerQuotas maxDepth="2147483647" maxStringContentLength="21 47483647"
maxArrayLength="2147483647 " maxBytesPerRead="214748364 7" maxNameTableCharCount="214 7483647" />
<endpoint address="https://api.myserver.net/APIFulfillmentHost/Transfer.svc/basic"
binding="basicHttpBinding" bindingConfiguration="Basi cHttpBindi ng_ITransf erService1 "
contract="APIFulfillmentSe rviceRefer ence.ITran sferServic e"
name="BasicHttpBinding_ITr ansferServ ice1" />
ITransferService APILogin = new TransferServiceClient();
However, when I run the below code
foreach (var results in APILogin.ILogin(this.txtUs
this.txtPassword.Text.ToSt
I receive the below error
The provided URI scheme 'https' is invalid; expected 'http'.
Parameter name: via
I'm using basicHTTPBinding. Below is what is in my web.config file.
<binding name="BasicHttpBinding_IMD
openTimeout="04:01:00" receiveTimeout="04:10:00" sendTimeout="04:01:00"
allowCookies="false" bypassProxyOnLocal="false"
maxBufferSize="2147483647"
messageEncoding="Text" textEncoding="utf-8" transferMode="StreamedRequ
useDefaultWebProxy="true">
<readerQuotas maxDepth="2147483647" maxStringContentLength="21
maxArrayLength="2147483647
<endpoint address="https://api.myserver.net/APIFulfillmentHost/Transfer.svc/basic"
binding="basicHttpBinding"
contract="APIFulfillmentSe
name="BasicHttpBinding_ITr
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
try below URI instead of yours
OLD: https://myserver/APIFulfillmentHost/Transfer.svc/basic
NEW: http://myserver/APIFulfillmentHost/Transfer.svc/basic
for https you need security certificate.
might it helps.
OLD: https://myserver/APIFulfillmentHost/Transfer.svc/basic
NEW: http://myserver/APIFulfillmentHost/Transfer.svc/basic
for https you need security certificate.
might it helps.
ASKER
I have a certificate for https. I want the service to go over SSL. If I change it to http then it won't have SSL
ASKER
Here is the actual Error:
<E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
<System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
<EventID>131075</EventID>
<Type>3</Type>
<SubType Name="Error">0</SubType>
<Level>2</Level>
<TimeCreated SystemTime="2012-04-03T14: 20:10.4252 369Z" />
<Source Name="System.ServiceModel" />
<Correlation ActivityID="{ae9918fb-2101 -42a1-951b -1b5c16f96 bd1}" />
<Execution ProcessName="WebDev.WebSer ver40" ProcessID="51072" ThreadID="5" />
<Channel />
<Computer>CV20</Computer>
</System>
<ApplicationData>
<TraceData>
<DataItem>
<TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Error">
<TraceIdentifier>http://msdn.microsoft.com/en-US/library/System.ServiceModel.Diagnostics.ThrowingException.aspx</TraceId entifier>
<Description>Throwing an exception.</Description>
<AppDomain>e92ab581-1-1297 7936373039 4987</AppD omain>
<Exception>
<ExceptionType>System.Serv iceModel.E ndpointNot FoundExcep tion, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c56193 4e089</Exc eptionType >
<Message>There was no endpoint listening at https://www.myorders.net/APIFulfillmentHost/MDRTransfer.svc/basic that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.</Message>
<StackTrace>
at System.ServiceModel.Channe ls.HttpCha nnelUtilit ies.Proces sGetRespon seWebExcep tion(WebEx ception webException, HttpWebRequest request, HttpAbortReason abortReason)
at System.ServiceModel.Channe ls.HttpCha nnelFactor y.HttpRequ estChannel .HttpChann elRequest. WaitForRep ly(TimeSpa n timeout)
at System.ServiceModel.Channe ls.Request Channel.Re quest(Mess age message, TimeSpan timeout)
at System.ServiceModel.Dispat cher.Reque stChannelB inder.Requ est(Messag e message, TimeSpan timeout)
at System.ServiceModel.Channe ls.Service Channel.Ca ll(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channe ls.Service ChannelPro xy.InvokeS ervice(IMe thodCallMe ssage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channe ls.Service ChannelPro xy.Invoke( IMessage message)
at System.Runtime.Remoting.Pr oxies.Real Proxy.Priv ateInvoke( MessageDat a& msgData, Int32 type)
at MDRAPIFulfillmentServiceRe ference.IM DRTransfer Service.MD RAPILogin( String UserName, String Password)
at MDRAPIFulfillmentServiceRe ference.MD RTransferS erviceClie nt.MDRAPIL ogin(Strin g UserName, String Password)
at _Default.cmdLogIn_Click(Ob ject sender, EventArgs e)
at System.Web.UI.WebControls. Button.OnC lick(Event Args e)
at System.Web.UI.WebControls. Button.Rai sePostBack Event(Stri ng eventArgument)
at System.Web.UI.WebControls. Button.Sys tem.Web.UI .IPostBack EventHandl er.RaisePo stBackEven t(String eventArgument)
at System.Web.UI.Page.RaisePo stBackEven t(IPostBac kEventHand ler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePo stBackEven t(NameValu eCollectio n postData)
at System.Web.UI.Page.Process RequestMai n(Boolean includeStagesBeforeAsyncPo int, Boolean includeStagesAfterAsyncPoi nt)
at System.Web.UI.Page.Process Request(Bo olean includeStagesBeforeAsyncPo int, Boolean includeStagesAfterAsyncPoi nt)
at System.Web.UI.Page.Process Request()
at System.Web.UI.Page.Process RequestWit hNoAssert( HttpContex t context)
at System.Web.UI.Page.Process Request(Ht tpContext context)
at ASP.default_aspx.ProcessRe quest(Http Context context)
at System.Web.HttpApplication .CallHandl erExecutio nStep.Syst em.Web.Htt pApplicati on.IExecut ionStep.Ex ecute()
at System.Web.HttpApplication .ExecuteSt ep(IExecut ionStep step, Boolean& completedSynchronously)
at System.Web.HttpApplication .Applicati onStepMana ger.Resume Steps(Exce ption error)
at System.Web.HttpApplication .System.We b.IHttpAsy ncHandler. BeginProce ssRequest( HttpContex t context, AsyncCallback cb, Object extraData)
at System.Web.HttpRuntime.Pro cessReques tInternal( HttpWorker Request wr)
at System.Web.HttpRuntime.Pro cessReques tNoDemand( HttpWorker Request wr)
at System.Web.HttpRuntime.Pro cessReques t(HttpWork erRequest wr)
at Microsoft.VisualStudio.Web Host.Reque st.Process ()
at Microsoft.VisualStudio.Web Host.Host. ProcessReq uest(Conne ction conn)
</StackTrace>
<ExceptionString>System.Se rviceModel .EndpointN otFoundExc eption: There was no endpoint listening at https://www.myorders.net/APIFulfillmentHost/MDRTransfer.svc/basic that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. ---> System.Net.WebException: The remote server returned an error: (404) Not Found.
at System.Net.HttpWebRequest. GetRespons e()
at System.ServiceModel.Channe ls.HttpCha nnelFactor y.HttpRequ estChannel .HttpChann elRequest. WaitForRep ly(TimeSpa n timeout)
--- End of inner exception stack trace ---</ExceptionString>
<InnerException>
<ExceptionType>System.Net. WebExcepti on, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c56193 4e089</Exc eptionType >
<Message>The remote server returned an error: (404) Not Found.</Message>
<StackTrace>
at System.Net.HttpWebRequest. GetRespons e()
at System.ServiceModel.Channe ls.HttpCha nnelFactor y.HttpRequ estChannel .HttpChann elRequest. WaitForRep ly(TimeSpa n timeout)
</StackTrace>
<ExceptionString>System.Ne t.WebExcep tion: The remote server returned an error: (404) Not Found.
at System.Net.HttpWebRequest. GetRespons e()
at System.ServiceModel.Channe ls.HttpCha nnelFactor y.HttpRequ estChannel .HttpChann elRequest. WaitForRep ly(TimeSpa n timeout)</ExceptionString>
</InnerException>
</Exception>
</TraceRecord>
</DataItem>
</TraceData>
</ApplicationData>
</E2ETraceEvent>
<E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
<System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
<EventID>131075</EventID>
<Type>3</Type>
<SubType Name="Error">0</SubType>
<Level>2</Level>
<TimeCreated SystemTime="2012-04-03T14:
<Source Name="System.ServiceModel"
<Correlation ActivityID="{ae9918fb-2101
<Execution ProcessName="WebDev.WebSer
<Channel />
<Computer>CV20</Computer>
</System>
<ApplicationData>
<TraceData>
<DataItem>
<TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Error">
<TraceIdentifier>http://msdn.microsoft.com/en-US/library/System.ServiceModel.Diagnostics.ThrowingException.aspx</TraceId
<Description>Throwing an exception.</Description>
<AppDomain>e92ab581-1-1297
<Exception>
<ExceptionType>System.Serv
<Message>There was no endpoint listening at https://www.myorders.net/APIFulfillmentHost/MDRTransfer.svc/basic that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.</Message>
<StackTrace>
at System.ServiceModel.Channe
at System.ServiceModel.Channe
at System.ServiceModel.Channe
at System.ServiceModel.Dispat
at System.ServiceModel.Channe
at System.ServiceModel.Channe
at System.ServiceModel.Channe
at System.Runtime.Remoting.Pr
at MDRAPIFulfillmentServiceRe
at MDRAPIFulfillmentServiceRe
at _Default.cmdLogIn_Click(Ob
at System.Web.UI.WebControls.
at System.Web.UI.WebControls.
at System.Web.UI.WebControls.
at System.Web.UI.Page.RaisePo
at System.Web.UI.Page.RaisePo
at System.Web.UI.Page.Process
at System.Web.UI.Page.Process
at System.Web.UI.Page.Process
at System.Web.UI.Page.Process
at System.Web.UI.Page.Process
at ASP.default_aspx.ProcessRe
at System.Web.HttpApplication
at System.Web.HttpApplication
at System.Web.HttpApplication
at System.Web.HttpApplication
at System.Web.HttpRuntime.Pro
at System.Web.HttpRuntime.Pro
at System.Web.HttpRuntime.Pro
at Microsoft.VisualStudio.Web
at Microsoft.VisualStudio.Web
</StackTrace>
<ExceptionString>System.Se
at System.Net.HttpWebRequest.
at System.ServiceModel.Channe
--- End of inner exception stack trace ---</ExceptionString>
<InnerException>
<ExceptionType>System.Net.
<Message>The remote server returned an error: (404) Not Found.</Message>
<StackTrace>
at System.Net.HttpWebRequest.
at System.ServiceModel.Channe
</StackTrace>
<ExceptionString>System.Ne
at System.Net.HttpWebRequest.
at System.ServiceModel.Channe
</InnerException>
</Exception>
</TraceRecord>
</DataItem>
</TraceData>
</ApplicationData>
</E2ETraceEvent>
ASKER
That solved original issue. Will repost new issue.
ASKER
Now i'm receiving below error after changing mode = Transport
"There was no endpoint listening at https://myserver/APIFulfillmentHost/Transfer.svc/basic that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details."
Any ideas? I've dropped the reference and added it again.