Appreciate for the help , As i have the client application ,which consumes the web methods. Before consuming the services i need to check that the "XXXXXXX" service status which i have consumed in the application whether is running or down in the host server. server is password protected. need help how to check the status of the service in the remote server.
Running status of the WebMethods,WCF,REST Full Service in the remote Server
Simple WCF with Username/Password Authentication
I have created a simple WCF web service and accompanying web application to host the service.
I'm able to deploy the web application to a test server (that is available to the public). What I need to do now is add username/password authentication to the web service. I do not want Windows Authentication and would like to avoid having to create and manage certificates. How can I do this?
Below is my unaltered web config:
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5"/>
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the values below to false before deployment -->
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<protocolMapping>
<add binding="basicHttpsBinding" scheme="https" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<!--
To browse web app root directory during debugging, set the value below to true.
Set to false before deployment to avoid disclosing web app folder information.
-->
<directoryBrowse enabled="true"/>
</system.webServer>
</configuration>
how to call session in .asmx page ?
Hi guys,
in general we can call session using this code :
string id; id = Session["LoginId"];
i thought the coding above can work inside the .asmx page but actually no.
my question is how to call session in .asmx page ?
Thank You & Regards,
Wibowo Wiwit
passing Date selection to Sp
I have 2 drop down lists, where i bind the data using web service from sql server database .
Now in the front end i can see the data in the drop down list.
Here is the procedure that i bind the data in 2 drop down list - start date and end date
Alter procedure dbo.Dates
select top 100 Desc as start date , Desc as end date from dbo. DateSelection
data looks like this in the frontend Example -
Start date end date
Wk 1 Jan 2010 Wk1 jan 2010
Wk 2 Jan 2010 Wk2 Jan 2010
Now the question is what ever dates i have selected in the drop down how can i pass this selection to below procedure where it has logic to filter.
Idea is Employee Id's which are selected in the front end will look like this
64747,84747,95858 etc....
on clicking on the Move button it will ask to select date parameter selection start date and end date..
I am trying to figure out how to pass date selection to the below procedure as well as Employee Id selection to below procedure..
ALTER PROCEDURE dbo.Employee
(
@IdList NVARCHAR(3500)
)
DECLARE
@SqlStatement NVARCHAR(4000) =
N'
INSERT INTO #Employee
(
EmployeeId
)
SELECT
EmployeeId
FROM
dbo.Employee
WHERE
EmployeeId IN (' + @IdList + N');
';
IF ( OBJECT_ID('tempdb..#Employee') IS NOT NULL )
DROP TABLE #Employee;
CREATE TABLE #Employee
(
EmployeeId INTEGER NOT NULL
)
EXEC ( @SqlStatement )
DROP TABLE #Employee;
RETURN;
END
Getting the following error while connecting to the below web service
Getting the following error while connecting to the below web service
{"Message":"Could not connect to http://10.10.10.122:81/WebService.asmx. TCP error code 10048: Only one usage of each socket address (protocol/network address/port) is normally permitted 10.10.10.122:81. ","StackTrace":"\r\nServer stack trace: \r\n
at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStream()\r\n at System.ServiceModel.Channels.HttpOutput.Send(TimeSpan timeout)\r\n at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.SendRequest(Message
message, TimeSpan timeout)\r\n at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)\r\n at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)\r\n at System.ServiceModel.Channels.ServiceChannel.Call(String
action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)\r\n at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)\r\n at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage
message)","ExceptionType":"System.ServiceModel.CommunicationException"}
Webservice get json parameter
Hello,
I need to write a webservice in visual studion 2015 that get in the parameter a json format.
the webservice function will go over the rows of the json and will insert this each row in the database.
Could you please give me an example and explain me how to do that?
Thank you in advance
Possible SOAP version mismatch: Envelope namespace
We have implemented a Web Service (Using Visual Studio .asmx file) and when we try to POST the client given XML (With Firefox Poster) we get the error:
soap:VersionMismatchSystem.Web.Services.Protocols.SoapException: Possible SOAP version mismatch: Envelope namespace client.Namespace was unexpected. Expectinghttp://schemas.xmlsoap.org/soap/envelope/.
Is there a way in Visual Studio webservices to change the validation xsd or to ignore the validation at all? Is there a way to change the Webservice line below through Visual Studio?
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
Keep in mind that the client cannot change the xml request….
Passing selected values from front end to stored procedure as parameters
I have a stored procedure where it accepts input parameter from front end. the result of the stored procedure will get 2 selected columns and these column data I need to bind to drop down list in the front end based on these parameters.
Any reference code can i get?
SOAP Web Service timing out after only 20 seconds in code but not in browser
Hi all, I am running into this issue with one of my web service calls.
We have an ASP.NET SOAP web service deployed on a server remotely. Everything works just fine. A few days ago we decided to deploy the exact same web service to a second server in a different location. The problem is, the exact same code on both the web service and client, fails when calling the web service on server #2, EXACTLY after 20 seconds, with the following error:
"The request channel timed out while waiting for a reply after 00:02:59.9111286. Increase the timeout value passed to the call to Request or increase the SendTimeout value on the Binding. The time allotted to this operation may have been a portion of a longer timeout."
Inner exception:
The HTTP request to 'http://-------------.asmx' has exceeded the allotted timeout of 00:02:59.9960000. The time allotted to this operation may have been a portion of a longer timeout.
Inner exception:
The request was aborted: The operation has timed out.
As you can see from the exception details, the timeout is set to 3 minutes but the exception is raised exactly after 20 seconds from the call, which leads me to believe that for some reason the serve is the one dropping the connection. Also calling the web service test page (the one served by IIS when accessing directly the asmx page) works just fine from a browser, with the response for a method being instantaneous.
I have analyzed the browser request headers and duplicated them in the code but no luck. Also that would not explain how one server works and one doesn't. The client is the same and I also called the web service on the two servers sequentially just to confirm that the call is exactly the same. One works, one doesn't.
Any suggestions would be greatly appreciated.
Also please let me know if more information is needed to figure this out.
Thank you.
Stefan
Getting error "The XML element 'EnableTheming' from namespace...." When running Web service
Hi everybody i am getting an error
The XML element 'EnableTheming' from namespace 'http://tempuri.org/' is already present in the current scope. Use XML attributes to specify another XML name or namespace for the element.
when i am running my webservice There is no error at build time its build up successfully.
I an getting this error when i return an asp.net pannel from my web method.. but when i am returning simple string its work fine..
Thnks in advance,
Raj
Can i access Web Services' Public variable in Client PC?
public string username, password, uType; bool access = false; [WebMethod] public Boolean LoginAccess(string EmailTextBox, string PasswordTextBox) { conn.Open(); SqlCommand comm = new SqlCommand("select username,upassword,uType from UserTble where username = '" + EmailTextBox + "'", conn); SqlDataReader reader = comm.ExecuteReader(); while (reader.Read()) { username = reader[0].ToString(); password = reader[1].ToString(); uType = reader[2].ToString(); } ... return access; } protected void LoginArrowButton_Click(object sender, EventArgs e) { bool isAccess = LoginService.LoginAccess(EmailBox.Text, PasswordBox.Text); if (isAccess) { Response.Redirect("http://localhost:1403/Default.aspx"); }else { } }
can i access uType varible of Web Service in Client PC? Kindly Help
QR Code read C#
How can we scan a QR code through a web interface (not an app) on a iPad using the iPad's camera?
Call java web service
hi how to call java web service and pass parameter from asp.net and how to receive the response
this is the java web method
@WebMethod public String SayHello(String name){ return "Hello " + name; }
Error When Get Result type DataTable form Web Service(ASMX)
I have problem in my web app with asmx web service
when i return Data type of DataTable include column (Int) give my error and this message error (-1 is not a valid value for int64)
befor is work fine but after i install new visaul studio 2015 not working my code is :
in web service (ASMX) :
[WebMethod]
public DataTable allchant(string password)
{
tablechantTableAdapter chanttable = new tablechantTableAdapter();
DataTable dt = new DataTable();
if(password=="thismyapp") dt = chanttable.GetData(); return dt; }
////////////////////////////////////////////////////////////////////////////////////////////
in my web app :
private void Btn2_Click(object sender, System.EventArgs e)
{
songservice.ZawamelService ws = new songservice.ZawamelService();
ws.allchantAsync("thismyapp"); ws.allchantCompleted +=Ws_allchantCompleted;}privatevoidWs_allchantCompleted(object sender, songservice.allchantCompletedEventArgs e){DataTable dt =newDataTable(); dt = e.Result;}
Although the appconfig file doesn't have all configuration, the wcftestclient works fine
Hi
I have a little question
I consume a wcf service and the client needs this configuration:
<binding name="wsHttpBindingConfiguration" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8"> <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> <security mode="None" /> </binding>
All clients need this configuration since the default values are limited. For instance, Wcfstorm and soapUI.
Now I want to use wcftestclient. I can see that the appconfig of wcftestclient doesn't have this configuration
The question is: How can wcftestclient work without all configuration in its appconfig?
https asp.net mvc website with valid certificate accessing WCF service hosted in http
Hello,
Our asp.net MVC website is hosted over https & secured with valid certificate from CA. It's trying to access the WCF service over http, but it's throwing the issue as :
Mixed Content: The page at 'https://localhost/...' was loaded over HTTPS, but requested an insecure script 'http://x.x.x.x.9999/signalr/hubs'. This request has been blocked; the content must be served over HTTPS.
We've used absolute URI for WCF service & client endpoint base addresses.
Any pointers will be appreciated.
Thanks,
Anindita
MDS JOIN between entity
Hello guys,
I'm now stuck on a problem with MDS (Master Data Service) and I don't know what to do, maybe you can give me a little tip.
In MDS is it possible to show a JOIN between two Entity (table)?
With subscription view with a entity in domain based with another entity it show only
nameand
codeof both entity. While with MDS API I didn't find nothing, only method that extract data from only one entity.
Do you have any advice?
Thank you very much
What type of application i have to make for getting streaming data in a specified time interval?
Hi,
In our project we have to get streaming data from API in a specified time interval(ex 1min once).After that i have to convert the data into json format and then i have to push the data into Azure IOT Hub.
For these what type of application i have to develop?
Ex
Console application?(It will crash if millions of input we get)
Wcf
or any other ?
The application should be run as a service ,it should keep on running to fetch the data from device API.
How to find the format type(xml,json,csv) from incoming dataset in windows service?
Iam trying to create a windows service,that should get data for every one minute from REST API ( for ex,open weather map site)or Applications or Device API.The data format may be
Xml
json
csv
Text
If incoming data is json it may be look like following(Without any content type header)
{"cnt":20,"list":[{"coord":{"lon":77.6,"lat":12.98},"sys":{"type":1,"id":7821,"message":0.0114,"country":"IN","sunrise":1503275880,"sunset":1503320823},"weather":[{"id":802,"main":"Clouds","description":"scattered clouds","icon":"03d"}],"main":{"temp":301.63,"pressure":1006,"humidity":58,"temp_min":301.15,"temp_max":302.15},"visibility":10000,"wind":{"speed":7.2,"deg":240},"clouds":{"all":40},"dt":1503316670,"id":1277333,"name":"Bangalore"}]}}
I can expect data set with out content type header.
if incoming data is json i can directly push into the IOT Hub
If it is XML or Text i have to convert it as a json and then i have to push the data to IOT Hub.
How can i find which type of data is coming ?
Passing parameters from frontend using webservice
Hi,
I have a java script file where we are getting selected Id's and these id's I want to pass to web service method where we are calling stored procedure (Sql server) these id's values should go as parameter to stored procedure and retrieve the data from procedure and bind in the drop down list.
Here is the code
Java script file
var params = [];
params.push(CreateNewParameter("IdList", GetConcatenateIdsToDownload(selectedId)))
var dsConfig = GetDataSource(StudentSvcUrl + "GetStudentParameter", params);
Interface
Interface
[OperationContract(Name = "GetStudentParameter")] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.WrappedRequest, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)] StdGenericList<StdDropdownListItem> GetStudentParameter(Dictionary<int, string> selectedId);
Svc Method
public StdGenericList<StdDropdownListItem> GetStudentParameter(Dictionary<string, string> selectedId)
{
What ever Id's we are selected that is coming from JS file, The issue is with svc method - I am not able to get it in dictionary (selectedId) it is showing as NULL when I debug it.