Quantcast
Channel: WCF, ASMX and other Web Services
Viewing all 555 articles
Browse latest View live

Problems with Hosting WCF service on IIS (Using WAS) for netTCP bindings?

$
0
0

<div class="vote"> </div><div class="post-text" itemprop="text">

I created a simple WCF service and hosted it in IIS by creating a new website. In Web.config file,I am providing bindings for http and net tcp. I created a console client and adding service reference. It generates two binding in client config - for http and for tcp. When I try to invoke the service using tcp, I get this error -

An unhandled exception of type 'System.ServiceModel.EndpointNotFoundException' occurred in mscorlib.dll Additional information: There was no endpoint listening at net.tcp://agoel.extron.com/Service.svc that could accept the message. This is often caused by an incorrect address or SOAP action.

when I run using Http endpoint , it works fine. Note - I am using Windows 10 OS, IIS 10.0 and WPAS\WAS (Windows Process Activation Service) are installed. I already enabled\checked HTTP Activation, TCP Activation in .Net framework in Windows features. And modified IIS server settings to include net tcp.

My website Web.config file looks like

<system.serviceModel><bindings><netTcpBinding><binding name="NewBinding0" portSharingEnabled="true"><security mode="None"  /></binding></netTcpBinding></bindings><services><service behaviorConfiguration="My" name="WCFServiceOM.Service1"> <!--  the service name must match the configuration name for the service implementation. --><endpoint address="" binding="basicHttpBinding" contract="WCFServiceOM.IService1"/><endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/><endpoint  binding="netTcpBinding" bindingConfiguration="NewBinding0" contract="WCFServiceOM.IService1" /><endpoint address="mexOM" binding="mexTcpBinding" contract="IMetadataExchange"/><host><baseAddresses><add baseAddress="net.tcp://localhost:8087/Service1" /><add baseAddress="http://localhost:7778/Service1"/></baseAddresses></host></service></services><behaviors><endpointBehaviors><behavior name="webBehanior"><webHttp/></behavior></endpointBehaviors><serviceBehaviors><behavior name="My"><!-- 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="true"/></behavior></serviceBehaviors></behaviors>

And my client App.Config look like

<configuration><startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" /></startup><system.serviceModel><!--<bindings><netTcpBinding><binding name="NetTcpBinding_OM" /></netTcpBinding></bindings><client><endpoint address="net.tcp://localhost/servicemodelsamples/service.svc"
            binding="netTcpBinding" bindingConfiguration="NetTcpBinding_OM"
            contract="ServiceReference1.IService1" name="NetTcpBinding_OM1" /></client>--><bindings><basicHttpBinding><binding name="BasicHttpBinding_IService1" /></basicHttpBinding><netTcpBinding><binding name="NetTcpBinding_IService1"><security mode="None" /></binding></netTcpBinding></bindings><client><endpoint address="http://domainname.company.com:7777/Service.svc"
            binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService1"
            contract="ServiceReference1.IService1" name="BasicHttpBinding_IService1" /><endpoint address="net.tcp://domainname.company.com/Service.svc" binding="netTcpBinding"
            bindingConfiguration="NetTcpBinding_IService1" contract="ServiceReference1.IService1"
            name="NetTcpBinding_IService1" /></client></system.serviceModel>

</div>

C# Making a request with a client certificate (p12 pem) to a Java/Unix based web service (Resin web server)

$
0
0

Hi,

For a client I'm developing a proxy class in C# for easy communication with a web service that's hosted on a Resin web server, which apparently is a Java/Unix environment.

For authentication with the web service I need to pass my client certificate with every request I make and that's were the trouble starts

I requested a client certificate from COMODO which I installed on my local machine. I exported this certificate to a p12 file with a private key.

To make myself known on the web server I had to upload a pem file to the web server so I used openssl to convert my p12 file to a pem file with a pass phrase and uploaded this to server which got accepted, contrary to my p12 file.

The manual of the web service supplies a code example making use of curl. I have to post three parameters and a xml file to a specified URL. My code looks as follows:

curl -E clientcertificate.pem:p4ssphr4se -F parameter1=xxx -F parameter2=xxx -F parameter3=xxx -F xml=@test.xml https://test.xxx/action/batchUpload


This code works like a charm.

Now I have to convert this curl command to C# code. I'm using a HttpClient object with a handler with a certificate. I can't use a pem-file in my C# code so I'm using the p12 file.

//try to create client certificate from settingsvar clientCertificatePath = appSettings[SETTING_KEY_CLIENT_CERTIFICATE_PATH];var clientCertificatePrivateKey = appSettings[SETTING_KEY_CLIENT_CERTIFICATE_PRIVATE_KEY];//create certificate from file 
_clientCertificate =new X509Certificate2(System.Web.HttpContext.Current.Server.MapPath(clientCertificatePath), clientCertificatePrivateKey);WebRequestHandler handler =newWebRequestHandler();
handler.ClientCertificates.Add(_clientCertificate);

_httpClient =newHttpClient(handler);var testFilePath =System.Web.HttpContext.Current.Server.MapPath(@"~\test.xml");using(var form =newMultipartFormDataContent()){
	form.Add(newStringContent("xxx"),"parameter1");
	form.Add(newStringContent("xxx"),"parameter2");
	form.Add(newStringContent("xxx"),"parameter3");var fileData =File.ReadAllBytes(testFilePath);var byteArrayContent =newByteArrayContent(fileData,0, fileData.Count());
	byteArrayContent.Headers.ContentType=newMediaTypeHeaderValue("application/xml");

	form.Add(byteArrayContent,"xml","test.xml");var response = _httpClient.PostAsync("https://test.xxx/action/batchUpload", form).Result;
using(HttpContent content = response.Content){// ... Read the string.Task<string> result = content.ReadAsStringAsync();var res = result.Result;System.Web.HttpContext.Current.Response.Write(res);}}



Now the problem I'm facing...

If I run this code, my request seems to be authenticated ok, because if I don't use a certificate I receive a nice 403-response. But I add the certificate like in the code I'm receiving a 500-response.

I compared the POST request I make with one I make with curl using Fiddler and the 100% the same the only difference is that in C# is use the p12-file and with curl I use the pem-file.

So for me it seems the problem is with the file format of the client certificate I use. I read a lot about the different formats and for me it's quit confusing but I understood that p12 files ar used on Windows based systems and pem files are used on Unix/Linux based systems. And I'm thinking the problem might has something to do with this...

Any help would be much appreciated!

How to debug WCF Service using net.tcp binding

$
0
0

Hello,

How to debug WCF Service using net.tcp binding in local(Development) environment but I able to debug for Http binding whether its possible to debug net.tcp?

Please help.

Regards,

Rangasamy

Web Services Always alive

$
0
0

I want to my web services always be alive when network connection is closed for any reasons. Assume, I have a download web method service,or there are processing on video or image by a web method in a web service, and in this time network is closed.

Is there any advise for resuming process, after network connection is connected or either, processes not be closed?

Receiving Type in Assembly is not marked as serializable

$
0
0

When clicking on a link I receive the following error:

Type 'QNet.ServiceRequest.DataContracts.IntakeServiceRequest' in Assembly 'QNet.ServiceRequest.DataContracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Runtime.Serialization.SerializationException: Type 'QNet.ServiceRequest.DataContracts.IntakeServiceRequest' in Assembly 'QNet.ServiceRequest.DataContracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[SerializationException: Type 'QNet.ServiceRequest.DataContracts.IntakeServiceRequest' in Assembly 'QNet.ServiceRequest.DataContracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable.]
   System.Runtime.Serialization.FormatterServices.InternalGetSerializableMembers(RuntimeType type) +7745307
   System.Runtime.Serialization.FormatterServices.GetSerializableMembers(Type type, StreamingContext context) +258
   System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitMemberInfo() +111
   System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter) +422
   System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.Serialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter) +51
   System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck) +410
   System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck) +134
   System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph) +13
   System.Web.UI.ObjectStateFormatter.SerializeValue(SerializerBinaryWriter writer, Object value) +845

[ArgumentException: Error serializing value 'QNet.ServiceRequest.DataContracts.IntakeServiceRequest' of type 'QNet.ServiceRequest.DataContracts.IntakeServiceRequest.']
   System.Web.UI.ObjectStateFormatter.SerializeValue(SerializerBinaryWriter writer, Object value) +3395
   System.Web.UI.ObjectStateFormatter.Serialize(Stream outputStream, Object stateGraph) +110
   System.Web.UI.ObjectStateFormatter.Serialize(Object stateGraph) +57
   System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Serialize(Object state) +4
   System.Web.UI.Util.SerializeWithAssert(IStateFormatter formatter, Object stateGraph) +37
   System.Web.UI.HiddenFieldPageStatePersister.Save() +79
   System.Web.UI.Page.SavePageStateToPersistenceMedium(Object state) +105
   System.Web.UI.Page.SaveAllState() +236
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1099

Receiving Type in Assembly is not marked as serializable error

$
0
0

When I click on a link I get the following error:

Type 'QNet.ServiceRequest.DataContracts.IntakeServiceRequest' in Assembly 'QNet.ServiceRequest.DataContracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable.
  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

 Exception Details: System.Runtime.Serialization.SerializationException: Type 'QNet.ServiceRequest.DataContracts.IntakeServiceRequest' in Assembly 'QNet.ServiceRequest.DataContracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable.

Source Error:


 An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:



[SerializationException: Type 'QNet.ServiceRequest.DataContracts.IntakeServiceRequest' in Assembly 'QNet.ServiceRequest.DataContracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable.]
   System.Runtime.Serialization.FormatterServices.InternalGetSerializableMembers(RuntimeType type) +7745307
   System.Runtime.Serialization.FormatterServices.GetSerializableMembers(Type type, StreamingContext context) +258
   System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitMemberInfo() +111
   System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter) +422
   System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.Serialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter) +51
   System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck) +410
   System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck) +134
   System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph) +13
   System.Web.UI.ObjectStateFormatter.SerializeValue(SerializerBinaryWriter writer, Object value) +845

[ArgumentException: Error serializing value 'QNet.ServiceRequest.DataContracts.IntakeServiceRequest' of type 'QNet.ServiceRequest.DataContracts.IntakeServiceRequest.']
   System.Web.UI.ObjectStateFormatter.SerializeValue(SerializerBinaryWriter writer, Object value) +3395
   System.Web.UI.ObjectStateFormatter.Serialize(Stream outputStream, Object stateGraph) +110
   System.Web.UI.ObjectStateFormatter.Serialize(Object stateGraph) +57
   System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Serialize(Object state) +4
   System.Web.UI.Util.SerializeWithAssert(IStateFormatter formatter, Object stateGraph) +37
   System.Web.UI.HiddenFieldPageStatePersister.Save() +79
   System.Web.UI.Page.SavePageStateToPersistenceMedium(Object state) +105
   System.Web.UI.Page.SaveAllState() +236
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1099

I confused because when I go to the page it talks of, it is clearly marked as WCFSerialization so I'm unsure of what it's speaking of or what it's looking for. I've stepped through the code hoping that it would fail on a particular line but it does not. Here is the code

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

using System;
using WcfSerialization = global::System.Runtime.Serialization;

namespace QNet.ServiceRequest.DataContracts
{
	/// <summary>
	/// Data Contract Class - IntakeServiceRequest
	/// </summary>
	[WcfSerialization::DataContract(Namespace = "urn:QNet.ServiceRequest.DataContract", Name = "IntakeServiceRequest")]
	public partial class IntakeServiceRequest
	{
		private System.Guid intakeServiceId;
		private int activeFlag;
		private string serviceRequestNumber;
		private string narrative;
		private string title;
		private string description;
		private System.Nullable<System.DateTime> reportedDate;
		private System.Nullable<System.DateTime> reportedTime;
		private string reportedArea;
		private string sourceArea;
		private string inputTypeValue;
		private string crossReferenceWith;
		private System.Nullable<System.DateTime> statusChangeDate;
		private string statusChangeDescription;
		private System.Nullable<int> dangerLevel;
		private string dangerReason;
		private bool accessLevel;
		private string updatedbyField;
		private System.Nullable<System.DateTime> updatedonField;
		private string insertedbyField;
		private System.Nullable<System.DateTime> insertedonField;
		private System.Nullable<System.DateTime> archiveOn;
		private string archiveBy;
		private byte[] timestampField;
		private System.DateTime effectiveDate;
		private System.Nullable<System.DateTime> expirationDate;
		private string serviceRequestIncidentTypeKey;
		private string reportedTypeKey;
		private System.Nullable<bool> reportedBySelf;
		private System.Nullable<bool> suspiciousDeath;
		private System.Nullable<bool> missingPersons;
		private System.Nullable<bool> sharedCareTaxCredit;
		private System.Nullable<int> sharedCareTaxCreditYear;
		private string agencyName;
		private string notes;
		private System.Nullable<bool> externalAgencyPhone;
		private System.Nullable<bool> externalAgencyFax;
		private System.Nullable<bool> externalAgencyEmail;
		private System.Nullable<bool> investigatable;
		private string visitInfo;
		private IntakeSerReqStatusType intakeSerReqStatusType;
		private System.Guid intakeSerReqStatusTypeId;
		private IntakeServiceRequestInputType intakeServiceRequestInputType;
		private System.Guid intakeServReqInputTypeId;
		private IntakeServiceRequestType intakeServiceRequestType;
		private System.Guid intakeServReqTypeId;
		private Priority priority;
		private System.Guid priorityId;
		private ServiceRequestSubType serviceRequestSubType;
		private System.Guid serviceRequestSubTypeId;
		private System.Collections.Generic.List<IntakeServiceRequestAgency> intakeServiceRequestAgency;
		private System.Collections.Generic.List<IntakeServiceRequestCustomForm> intakeServiceRequestCustomForm;
		private System.Collections.Generic.List<IntakeServiceRequestDetail> intakeServiceRequestDetail;
		private System.Collections.Generic.List<IntakeServiceRequestNatureCode> intakeServiceRequestNatureCode;
		private System.Collections.Generic.List<IntakeServiceRequestQuestionAnswer> intakeServiceRequestQuestionAnswer;
		private System.Collections.Generic.List<IntakeServiceRequestReason> intakeServiceRequestReason;
		private System.Collections.Generic.List<IntakeServiceRequestReview> intakeServiceRequestReview;
		private System.Collections.Generic.List<IntakeServiceRequestService> intakeServiceRequestService;
		private System.Collections.Generic.List<AreaTeamMemberServiceRequest> areaTeamMemberServiceRequest;
		private System.Collections.Generic.List<IntakeServiceRequestUserAccess> intakeServiceRequestUserAccess;
		private System.Collections.Generic.List<IntakeServiceRequestHistory> intakeServiceRequestHistory;
		private System.Collections.Generic.List<IntakeServiceRequestDispositionCode> intakeServiceRequestDispositionCode;
		private System.Collections.Generic.List<IntakeServiceRequestGroupDetails> intakeServiceRequestGroupDetails;
		private System.Collections.Generic.List<Investigation> investigation;
		private System.Collections.Generic.List<IntakeServiceRequestClearingData> intakeServiceRequestClearingData;
		private System.Collections.Generic.List<IntakeServiceRequestReferralDetail> intakeServiceRequestReferralDetail;
		private System.Collections.Generic.List<IntakeServiceRequestWeaver> intakeServiceRequestWeaver;
		private System.Nullable<bool> illegalActivity;
		private string intakeServiceRequestIllegalActivityTypeKey;
		private System.Collections.Generic.List<IntakeServiceRequestActor> intakeServiceRequestActor;
		private System.Collections.Generic.List<IntakeServiceRequestCrossReference> intakeServiceRequestCrossReference;
		private System.Collections.Generic.List<IntakeServiceRequestIllegalActivity> intakeServiceRequestIllegalActivity;
		private System.Collections.Generic.List<IntakeServiceRequestCorrection> intakeServiceRequestCorrection;
		private System.Nullable<System.DateTime> targetCompleteDate;
		private System.Nullable<bool> supervisorReview;
		private System.Nullable<bool> rARejectedMedicaidStatus;
		private System.Nullable<bool> moneyFollowsPerson;
		private System.Nullable<System.DateTime> iM54ADate;
		private System.Nullable<bool> hCB;
		private System.Nullable<System.DateTime> adverseActionDate;
		private System.Nullable<System.DateTime> applicationHearingReceivedDate;
		private System.Nullable<System.DateTime> reversalAdverseActionDate;
		private string mONumber;

		[WcfSerialization::DataMember(Name = "IntakeServiceId", IsRequired = false, Order = 0)]
		public System.Guid IntakeServiceId
		{
		  get { return intakeServiceId; }
		  set { intakeServiceId = value; }
		}

		[WcfSerialization::DataMember(Name = "ActiveFlag", IsRequired = false, Order = 1)]
		public int ActiveFlag
		{
		  get { return activeFlag; }
		  set { activeFlag = value; }
		}

		[WcfSerialization::DataMember(Name = "ServiceRequestNumber", IsRequired = false, Order = 2)]
		public string ServiceRequestNumber
		{
		  get { return serviceRequestNumber; }
		  set { serviceRequestNumber = value; }
		}

		[WcfSerialization::DataMember(Name = "Narrative", IsRequired = false, Order = 3)]
		public string Narrative
		{
		  get { return narrative; }
		  set { narrative = value; }
		}

		[WcfSerialization::DataMember(Name = "Title", IsRequired = false, Order = 4)]
		public string Title
		{
		  get { return title; }
		  set { title = value; }
		}

		[WcfSerialization::DataMember(Name = "Description", IsRequired = false, Order = 5)]
		public string Description
		{
		  get { return description; }
		  set { description = value; }
		}

		[WcfSerialization::DataMember(Name = "ReportedDate", IsRequired = false, Order = 6)]
		public System.Nullable<System.DateTime> ReportedDate
		{
		  get { return reportedDate; }
		  set { reportedDate = value; }
		}

		[WcfSerialization::DataMember(Name = "ReportedTime", IsRequired = false, Order = 7)]
		public System.Nullable<System.DateTime> ReportedTime
		{
		  get { return reportedTime; }
		  set { reportedTime = value; }
		}

		[WcfSerialization::DataMember(Name = "ReportedArea", IsRequired = false, Order = 8)]
		public string ReportedArea
		{
		  get { return reportedArea; }
		  set { reportedArea = value; }
		}

		[WcfSerialization::DataMember(Name = "SourceArea", IsRequired = false, Order = 9)]
		public string SourceArea
		{
		  get { return sourceArea; }
		  set { sourceArea = value; }
		}

		[WcfSerialization::DataMember(Name = "InputTypeValue", IsRequired = false, Order = 10)]
		public string InputTypeValue
		{
		  get { return inputTypeValue; }
		  set { inputTypeValue = value; }
		}

		[WcfSerialization::DataMember(Name = "CrossReferenceWith", IsRequired = false, Order = 11)]
		public string CrossReferenceWith
		{
		  get { return crossReferenceWith; }
		  set { crossReferenceWith = value; }
		}

		[WcfSerialization::DataMember(Name = "StatusChangeDate", IsRequired = false, Order = 12)]
		public System.Nullable<System.DateTime> StatusChangeDate
		{
		  get { return statusChangeDate; }
		  set { statusChangeDate = value; }
		}

		[WcfSerialization::DataMember(Name = "StatusChangeDescription", IsRequired = false, Order = 13)]
		public string StatusChangeDescription
		{
		  get { return statusChangeDescription; }
		  set { statusChangeDescription = value; }
		}

		[WcfSerialization::DataMember(Name = "DangerLevel", IsRequired = false, Order = 14)]
		public System.Nullable<int> DangerLevel
		{
		  get { return dangerLevel; }
		  set { dangerLevel = value; }
		}

		[WcfSerialization::DataMember(Name = "DangerReason", IsRequired = false, Order = 15)]
		public string DangerReason
		{
		  get { return dangerReason; }
		  set { dangerReason = value; }
		}

		[WcfSerialization::DataMember(Name = "AccessLevel", IsRequired = false, Order = 16)]
		public bool AccessLevel
		{
		  get { return accessLevel; }
		  set { accessLevel = value; }
		}

		[WcfSerialization::DataMember(Name = "updatedby", IsRequired = false, Order = 17)]
		public string updatedby
		{
		  get { return updatedbyField; }
		  set { updatedbyField = value; }
		}

		[WcfSerialization::DataMember(Name = "updatedon", IsRequired = false, Order = 18)]
		public System.Nullable<System.DateTime> updatedon
		{
		  get { return updatedonField; }
		  set { updatedonField = value; }
		}

		[WcfSerialization::DataMember(Name = "insertedby", IsRequired = false, Order = 19)]
		public string insertedby
		{
		  get { return insertedbyField; }
		  set { insertedbyField = value; }
		}

		[WcfSerialization::DataMember(Name = "insertedon", IsRequired = false, Order = 20)]
		public System.Nullable<System.DateTime> insertedon
		{
		  get { return insertedonField; }
		  set { insertedonField = value; }
		}

		[WcfSerialization::DataMember(Name = "ArchiveOn", IsRequired = false, Order = 21)]
		public System.Nullable<System.DateTime> ArchiveOn
		{
		  get { return archiveOn; }
		  set { archiveOn = value; }
		}

		[WcfSerialization::DataMember(Name = "ArchiveBy", IsRequired = false, Order = 22)]
		public string ArchiveBy
		{
		  get { return archiveBy; }
		  set { archiveBy = value; }
		}

		[WcfSerialization::DataMember(Name = "timestamp", IsRequired = false, Order = 23)]
		public byte[] timestamp
		{
		  get { return timestampField; }
		  set { timestampField = value; }
		}

		[WcfSerialization::DataMember(Name = "EffectiveDate", IsRequired = false, Order = 24)]
		public System.DateTime EffectiveDate
		{
		  get { return effectiveDate; }
		  set { effectiveDate = value; }
		}

		[WcfSerialization::DataMember(Name = "ExpirationDate", IsRequired = false, Order = 25)]
		public System.Nullable<System.DateTime> ExpirationDate
		{
		  get { return expirationDate; }
		  set { expirationDate = value; }
		}

		[WcfSerialization::DataMember(Name = "ServiceRequestIncidentTypeKey", IsRequired = false, Order = 26)]
		public string ServiceRequestIncidentTypeKey
		{
		  get { return serviceRequestIncidentTypeKey; }
		  set { serviceRequestIncidentTypeKey = value; }
		}

		[WcfSerialization::DataMember(Name = "ReportedTypeKey", IsRequired = false, Order = 27)]
		public string ReportedTypeKey
		{
		  get { return reportedTypeKey; }
		  set { reportedTypeKey = value; }
		}

		[WcfSerialization::DataMember(Name = "ReportedBySelf", IsRequired = false, Order = 28)]
		public System.Nullable<bool> ReportedBySelf
		{
		  get { return reportedBySelf; }
		  set { reportedBySelf = value; }
		}

		[WcfSerialization::DataMember(Name = "SuspiciousDeath", IsRequired = false, Order = 29)]
		public System.Nullable<bool> SuspiciousDeath
		{
		  get { return suspiciousDeath; }
		  set { suspiciousDeath = value; }
		}

		[WcfSerialization::DataMember(Name = "MissingPersons", IsRequired = false, Order = 30)]
		public System.Nullable<bool> MissingPersons
		{
		  get { return missingPersons; }
		  set { missingPersons = value; }
		}

		[WcfSerialization::DataMember(Name = "SharedCareTaxCredit", IsRequired = false, Order = 31)]
		public System.Nullable<bool> SharedCareTaxCredit
		{
		  get { return sharedCareTaxCredit; }
		  set { sharedCareTaxCredit = value; }
		}

		[WcfSerialization::DataMember(Name = "SharedCareTaxCreditYear", IsRequired = false, Order = 32)]
		public System.Nullable<int> SharedCareTaxCreditYear
		{
		  get { return sharedCareTaxCreditYear; }
		  set { sharedCareTaxCreditYear = value; }
		}

		[WcfSerialization::DataMember(Name = "AgencyName", IsRequired = false, Order = 33)]
		public string AgencyName
		{
		  get { return agencyName; }
		  set { agencyName = value; }
		}

		[WcfSerialization::DataMember(Name = "Notes", IsRequired = false, Order = 34)]
		public string Notes
		{
		  get { return notes; }
		  set { notes = value; }
		}

		[WcfSerialization::DataMember(Name = "ExternalAgencyPhone", IsRequired = false, Order = 35)]
		public System.Nullable<bool> ExternalAgencyPhone
		{
		  get { return externalAgencyPhone; }
		  set { externalAgencyPhone = value; }
		}

		[WcfSerialization::DataMember(Name = "ExternalAgencyFax", IsRequired = false, Order = 36)]
		public System.Nullable<bool> ExternalAgencyFax
		{
		  get { return externalAgencyFax; }
		  set { externalAgencyFax = value; }
		}

		[WcfSerialization::DataMember(Name = "ExternalAgencyEmail", IsRequired = false, Order = 37)]
		public System.Nullable<bool> ExternalAgencyEmail
		{
		  get { return externalAgencyEmail; }
		  set { externalAgencyEmail = value; }
		}

		[WcfSerialization::DataMember(Name = "Investigatable", IsRequired = false, Order = 38)]
		public System.Nullable<bool> Investigatable
		{
		  get { return investigatable; }
		  set { investigatable = value; }
		}

		[WcfSerialization::DataMember(Name = "VisitInfo", IsRequired = false, Order = 39)]
		public string VisitInfo
		{
		  get { return visitInfo; }
		  set { visitInfo = value; }
		}

		[WcfSerialization::DataMember(Name = "IntakeSerReqStatusType", IsRequired = false, Order = 40)]
		public IntakeSerReqStatusType IntakeSerReqStatusType
		{
		  get { return intakeSerReqStatusType; }
		  set { intakeSerReqStatusType = value; }
		}

		[WcfSerialization::DataMember(Name = "IntakeSerReqStatusTypeId", IsRequired = false, Order = 41)]
		public System.Guid IntakeSerReqStatusTypeId
		{
		  get { return intakeSerReqStatusTypeId; }
		  set { intakeSerReqStatusTypeId = value; }
		}

		[WcfSerialization::DataMember(Name = "IntakeServiceRequestInputType", IsRequired = false, Order = 42)]
		public IntakeServiceRequestInputType IntakeServiceRequestInputType
		{
		  get { return intakeServiceRequestInputType; }
		  set { intakeServiceRequestInputType = value; }
		}

		[WcfSerialization::DataMember(Name = "IntakeServReqInputTypeId", IsRequired = false, Order = 43)]
		public System.Guid IntakeServReqInputTypeId
		{
		  get { return intakeServReqInputTypeId; }
		  set { intakeServReqInputTypeId = value; }
		}

		[WcfSerialization::DataMember(Name = "IntakeServiceRequestType", IsRequired = false, Order = 44)]
		public IntakeServiceRequestType IntakeServiceRequestType
		{
		  get { return intakeServiceRequestType; }
		  set { intakeServiceRequestType = value; }
		}

		[WcfSerialization::DataMember(Name = "IntakeServReqTypeId", IsRequired = false, Order = 45)]
		public System.Guid IntakeServReqTypeId
		{
		  get { return intakeServReqTypeId; }
		  set { intakeServReqTypeId = value; }
		}

		[WcfSerialization::DataMember(Name = "Priority", IsRequired = false, Order = 46)]
		public Priority Priority
		{
		  get { return priority; }
		  set { priority = value; }
		}

		[WcfSerialization::DataMember(Name = "PriorityId", IsRequired = false, Order = 47)]
		public System.Guid PriorityId
		{
		  get { return priorityId; }
		  set { priorityId = value; }
		}

		[WcfSerialization::DataMember(Name = "ServiceRequestSubType", IsRequired = false, Order = 48)]
		public ServiceRequestSubType ServiceRequestSubType
		{
		  get { return serviceRequestSubType; }
		  set { serviceRequestSubType = value; }
		}

		[WcfSerialization::DataMember(Name = "ServiceRequestSubTypeId", IsRequired = false, Order = 49)]
		public System.Guid ServiceRequestSubTypeId
		{
		  get { return serviceRequestSubTypeId; }
		  set { serviceRequestSubTypeId = value; }
		}

		[WcfSerialization::DataMember(Name = "IntakeServiceRequestAgency", IsRequired = false, Order = 50)]
		public System.Collections.Generic.List<IntakeServiceRequestAgency> IntakeServiceRequestAgency
		{
		  get { return intakeServiceRequestAgency; }
		  set { intakeServiceRequestAgency = value; }
		}

		[WcfSerialization::DataMember(Name = "IntakeServiceRequestCustomForm", IsRequired = false, Order = 51)]
		public System.Collections.Generic.List<IntakeServiceRequestCustomForm> IntakeServiceRequestCustomForm
		{
		  get { return intakeServiceRequestCustomForm; }
		  set { intakeServiceRequestCustomForm = value; }
		}

		[WcfSerialization::DataMember(Name = "IntakeServiceRequestDetail", IsRequired = false, Order = 52)]
		public System.Collections.Generic.List<IntakeServiceRequestDetail> IntakeServiceRequestDetail
		{
		  get { return intakeServiceRequestDetail; }
		  set { intakeServiceRequestDetail = value; }
		}

		[WcfSerialization::DataMember(Name = "IntakeServiceRequestNatureCode", IsRequired = false, Order = 53)]
		public System.Collections.Generic.List<IntakeServiceRequestNatureCode> IntakeServiceRequestNatureCode
		{
		  get { return intakeServiceRequestNatureCode; }
		  set { intakeServiceRequestNatureCode = value; }
		}

		[WcfSerialization::DataMember(Name = "IntakeServiceRequestQuestionAnswer", IsRequired = false, Order = 54)]
		public System.Collections.Generic.List<IntakeServiceRequestQuestionAnswer> IntakeServiceRequestQuestionAnswer
		{
		  get { return intakeServiceRequestQuestionAnswer; }
		  set { intakeServiceRequestQuestionAnswer = value; }
		}

		[WcfSerialization::DataMember(Name = "IntakeServiceRequestReason", IsRequired = false, Order = 55)]
		public System.Collections.Generic.List<IntakeServiceRequestReason> IntakeServiceRequestReason
		{
		  get { return intakeServiceRequestReason; }
		  set { intakeServiceRequestReason = value; }
		}

		[WcfSerialization::DataMember(Name = "IntakeServiceRequestReview", IsRequired = false, Order = 56)]
		public System.Collections.Generic.List<IntakeServiceRequestReview> IntakeServiceRequestReview
		{
		  get { return intakeServiceRequestReview; }
		  set { intakeServiceRequestReview = value; }
		}

		[WcfSerialization::DataMember(Name = "IntakeServiceRequestService", IsRequired = false, Order = 57)]
		public System.Collections.Generic.List<IntakeServiceRequestService> IntakeServiceRequestService
		{
		  get { return intakeServiceRequestService; }
		  set { intakeServiceRequestService = value; }
		}

		[WcfSerialization::DataMember(Name = "AreaTeamMemberServiceRequest", IsRequired = false, Order = 58)]
		public System.Collections.Generic.List<AreaTeamMemberServiceRequest> AreaTeamMemberServiceRequest
		{
		  get { return areaTeamMemberServiceRequest; }
		  set { areaTeamMemberServiceRequest = value; }
		}

		[WcfSerialization::DataMember(Name = "IntakeServiceRequestUserAccess", IsRequired = false, Order = 59)]
		public System.Collections.Generic.List<IntakeServiceRequestUserAccess> IntakeServiceRequestUserAccess
		{
		  get { return intakeServiceRequestUserAccess; }
		  set { intakeServiceRequestUserAccess = value; }
		}

		[WcfSerialization::DataMember(Name = "IntakeServiceRequestHistory", IsRequired = false, Order = 60)]
		public System.Collections.Generic.List<IntakeServiceRequestHistory> IntakeServiceRequestHistory
		{
		  get { return intakeServiceRequestHistory; }
		  set { intakeServiceRequestHistory = value; }
		}

		[WcfSerialization::DataMember(Name = "IntakeServiceRequestDispositionCode", IsRequired = false, Order = 61)]
		public System.Collections.Generic.List<IntakeServiceRequestDispositionCode> IntakeServiceRequestDispositionCode
		{
		  get { return intakeServiceRequestDispositionCode; }
		  set { intakeServiceRequestDispositionCode = value; }
		}

		[WcfSerialization::DataMember(Name = "IntakeServiceRequestGroupDetails", IsRequired = false, Order = 62)]
		public System.Collections.Generic.List<IntakeServiceRequestGroupDetails> IntakeServiceRequestGroupDetails
		{
		  get { return intakeServiceRequestGroupDetails; }
		  set { intakeServiceRequestGroupDetails = value; }
		}

		[WcfSerialization::DataMember(Name = "Investigation", IsRequired = false, Order = 63)]
		public System.Collections.Generic.List<Investigation> Investigation
		{
		  get { return investigation; }
		  set { investigation = value; }
		}

		[WcfSerialization::DataMember(Name = "IntakeServiceRequestClearingData", IsRequired = false, Order = 64)]
		public System.Collections.Generic.List<IntakeServiceRequestClearingData> IntakeServiceRequestClearingData
		{
		  get { return intakeServiceRequestClearingData; }
		  set { intakeServiceRequestClearingData = value; }
		}

		[WcfSerialization::DataMember(Name = "IntakeServiceRequestReferralDetail", IsRequired = false, Order = 65)]
		public System.Collections.Generic.List<IntakeServiceRequestReferralDetail> IntakeServiceRequestReferralDetail
		{
		  get { return intakeServiceRequestReferralDetail; }
		  set { intakeServiceRequestReferralDetail = value; }
		}

		[WcfSerialization::DataMember(Name = "IntakeServiceRequestWeaver", IsRequired = false, Order = 66)]
		public System.Collections.Generic.List<IntakeServiceRequestWeaver> IntakeServiceRequestWeaver
		{
		  get { return intakeServiceRequestWeaver; }
		  set { intakeServiceRequestWeaver = value; }
		}

		[WcfSerialization::DataMember(Name = "IllegalActivity", IsRequired = false, Order = 67)]
		public System.Nullable<bool> IllegalActivity
		{
		  get { return illegalActivity; }
		  set { illegalActivity = value; }
		}

		[WcfSerialization::DataMember(Name = "IntakeServiceRequestIllegalActivityTypeKey", IsRequired = false, Order = 68)]
		public string IntakeServiceRequestIllegalActivityTypeKey
		{
		  get { return intakeServiceRequestIllegalActivityTypeKey; }
		  set { intakeServiceRequestIllegalActivityTypeKey = value; }
		}

		[WcfSerialization::DataMember(Name = "IntakeServiceRequestActor", IsRequired = false, Order = 69)]
		public System.Collections.Generic.List<IntakeServiceRequestActor> IntakeServiceRequestActor
		{
		  get { return intakeServiceRequestActor; }
		  set { intakeServiceRequestActor = value; }
		}

		[WcfSerialization::DataMember(Name = "IntakeServiceRequestCrossReference", IsRequired = false, Order = 70)]
		public System.Collections.Generic.List<IntakeServiceRequestCrossReference> IntakeServiceRequestCrossReference
		{
		  get { return intakeServiceRequestCrossReference; }
		  set { intakeServiceRequestCrossReference = value; }
		}

		[WcfSerialization::DataMember(Name = "IntakeServiceRequestIllegalActivity", IsRequired = false, Order = 71)]
		public System.Collections.Generic.List<IntakeServiceRequestIllegalActivity> IntakeServiceRequestIllegalActivity
		{
		  get { return intakeServiceRequestIllegalActivity; }
		  set { intakeServiceRequestIllegalActivity = value; }
		}

		[WcfSerialization::DataMember(Name = "IntakeServiceRequestCorrection", IsRequired = false, Order = 72)]
		public System.Collections.Generic.List<IntakeServiceRequestCorrection> IntakeServiceRequestCorrection
		{
		  get { return intakeServiceRequestCorrection; }
		  set { intakeServiceRequestCorrection = value; }
		}

		[WcfSerialization::DataMember(Name = "TargetCompleteDate", IsRequired = false, Order = 73)]
		public System.Nullable<System.DateTime> TargetCompleteDate
		{
		  get { return targetCompleteDate; }
		  set { targetCompleteDate = value; }
		}

		[WcfSerialization::DataMember(Name = "SupervisorReview", IsRequired = false, Order = 74)]
		public System.Nullable<bool> SupervisorReview
		{
		  get { return supervisorReview; }
		  set { supervisorReview = value; }
		}

		[WcfSerialization::DataMember(Name = "RARejectedMedicaidStatus", IsRequired = false, Order = 75)]
		public System.Nullable<bool> RARejectedMedicaidStatus
		{
		  get { return rARejectedMedicaidStatus; }
		  set { rARejectedMedicaidStatus = value; }
		}

		[WcfSerialization::DataMember(Name = "MoneyFollowsPerson", IsRequired = false, Order = 76)]
		public System.Nullable<bool> MoneyFollowsPerson
		{
		  get { return moneyFollowsPerson; }
		  set { moneyFollowsPerson = value; }
		}

		[WcfSerialization::DataMember(Name = "IM54ADate", IsRequired = false, Order = 77)]
		public System.Nullable<System.DateTime> IM54ADate
		{
		  get { return iM54ADate; }
		  set { iM54ADate = value; }
		}

		[WcfSerialization::DataMember(Name = "HCB", IsRequired = false, Order = 78)]
		public System.Nullable<bool> HCB
		{
		  get { return hCB; }
		  set { hCB = value; }
		}

		[WcfSerialization::DataMember(Name = "AdverseActionDate", IsRequired = false, Order = 79)]
		public System.Nullable<System.DateTime> AdverseActionDate
		{
		  get { return adverseActionDate; }
		  set { adverseActionDate = value; }
		}

		[WcfSerialization::DataMember(Name = "ApplicationHearingReceivedDate", IsRequired = false, Order = 80)]
		public System.Nullable<System.DateTime> ApplicationHearingReceivedDate
		{
		  get { return applicationHearingReceivedDate; }
		  set { applicationHearingReceivedDate = value; }
		}

		[WcfSerialization::DataMember(Name = "ReversalAdverseActionDate", IsRequired = false, Order = 81)]
		public System.Nullable<System.DateTime> ReversalAdverseActionDate
		{
		  get { return reversalAdverseActionDate; }
		  set { reversalAdverseActionDate = value; }
		}

		[WcfSerialization::DataMember(Name = "MONumber", IsRequired = false, Order = 82)]
		public string MONumber
		{
		  get { return mONumber; }
		  set { mONumber = value; }
		}
	}
}


How to consume an external wcf service

$
0
0

Hi ,

How to consume an external WCF service without adding service reference?

TIA

Vivek

Eat by online using Just Eat clone script | Food Panda Clone

$
0
0

Smart eat Just eat clone script fits the divergent entrepreneur who wants to step into online food ordering business .Nowadays, ordering and eating food got more smarter. Lot of people order their food by means of internet. Many food ordering sites are launched and getting decent profit in the market. Major advantage of food ordering site is, able to compare the foods and ingredients mixed in the food, time of delivery and availability of food. This script comes with key features like PayPal integration, Invoice generation, SMS integration, etc..


convert Node.JS webservice call to C#

$
0
0

Hi Folks,

I have an Node.JS script which is making a webservice call the script works great , i am looking to convert this Node.JS script to C# webservice call.

Can someone please help. Thanks in advance.

var request = require('request');
var fs = require('fs');
var url = "https://yoururl/API/v3/responseimports";
var surveyId = "SV_ePswPpv4rPD77fL";
var token="AXXXXXXXXXXXXXZZZZ";
var formData={
	surveyId:surveyId,
	file: fs.createReadStream("test.csv")
};

var options = {
	headers:{
		'content-type':'multipart/form-data',
		'X-API-TOKEN':token
	},
	method:"POST",
	url:url,
	formData: formData
};

request(options, function(error,response,body){
	if(error){
		console.log("Error" +error);
	}
	else{
		console.log(response.body);
		console.log("webservice call completed");
		console.log(response.statusCode);

	}

});

Pass a C#/ ASP variable from to a website

$
0
0

Hello, I'm fairly new to C# and can't seem to find an answer.

I am trying to pass a variable from a C#/ ASP website to an element of a website on a newly opened tab when a button is pressed.

The following code opens the page on a new tab successfully:

protected void SA_Click(object sender, EventArgs e)
    {
        string pageurl = "https://web.nt-ware.net/license/serialinfo.php";
        Response.Write("<script> window.open('" + pageurl + "','_blank'); </script>");
    }

Every answer I've found seems to be the opposite where the user brings data back from a websit.

I know the ID of the element is info_on_srn and I can get this to work in PowerShell using:

$ie.Document.IHTMLDocument3_getElementByID("info_on_srn").value

WebService (SOAP) - Remove the Protocol suffix in wsdl file

$
0
0

I want to remove the Protocol suffix: Soap, SoapIn, SoapOut

<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://www.proiam.com/PMItemAndLocationEnquiry/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://www.proiam.com/PMItemAndLocationEnquiry/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
  <wsdl:types>
    <s:schema elementFormDefault="qualified" targetNamespace="http://www.proiam.com/PMItemAndLocationEnquiry/">
      <s:element name="getCompleteItemNumberRequest" type="s:string" />
      <s:element name="getCompleteItemNumberResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="unbounded" form="unqualified" name="ItemNumber" type="s:string" />
          </s:sequence>
          <s:attribute name="ErrorMessage" type="s:string" />
          <s:attribute name="ErrorCode" type="s:int" />
          <s:attribute name="BarCodeCount" type="s:int" />
        </s:complexType>
      </s:element>
      <s:element name="ListPostOfficeRequest" type="s:string" />
      <s:element name="ListPostOfficesResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" form="unqualified" name="ListPostOfficeResult" type="tns:ListPostOfficeResultType" />
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:complexType name="ListPostOfficeResultType">
        <s:complexContent mixed="false">
          <s:extension base="tns:ListPostOfficesResultBaseType">
            <s:sequence>
              <s:element minOccurs="0" maxOccurs="1" form="unqualified" name="PostOffices" type="tns:ArrayOfPostOffice" />
            </s:sequence>
          </s:extension>
        </s:complexContent>
      </s:complexType>
      <s:complexType name="ListPostOfficesResultBaseType">
        <s:sequence>
          <s:element minOccurs="1" maxOccurs="1" form="unqualified" name="ErrorCode" type="s:int" />
          <s:element minOccurs="0" maxOccurs="1" form="unqualified" name="ErrorMessage" type="s:string" />
        </s:sequence>
      </s:complexType>
      <s:complexType name="ArrayOfPostOffice">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="unbounded" form="unqualified" name="PostOffice" type="tns:PostOffice" />
        </s:sequence>
      </s:complexType>
      <s:complexType name="PostOffice">
        <s:attribute name="Name" type="s:string" />
        <s:attribute name="Code" type="s:string" />
      </s:complexType>
      <s:element name="ValidationPriorCaseCreationRequest">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="1" maxOccurs="1" form="unqualified" name="Request_Type">
              <s:simpleType>
                <s:restriction base="s:string">
                  <s:enumeration value="V" />
                  <s:enumeration value="D" />
                  <s:enumeration value="S" />
                  <s:enumeration value="M" />
                  <s:enumeration value="P" />
                  <s:enumeration value="Q" />
                </s:restriction>
              </s:simpleType>
            </s:element>
            <s:element minOccurs="0" maxOccurs="1" form="unqualified" name="Po_Code" type="s:string" />
            <s:element minOccurs="0" maxOccurs="1" form="unqualified" name="PoTransfer_Code" type="s:string" />
            <s:element minOccurs="0" maxOccurs="1" form="unqualified" name="Prefered_Date" type="s:string" />
            <s:element minOccurs="0" maxOccurs="1" form="unqualified" name="Contact_No" type="s:string" />
            <s:element minOccurs="0" maxOccurs="1" form="unqualified" name="Po_Postal_Code" type="s:string" />
          </s:sequence>
          <s:attribute name="Item_No" type="s:string" />
        </s:complexType>
      </s:element>
      <s:element name="ValidationPriorCaseCreationResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" form="unqualified" name="Result_Code" type="s:string" />
            <s:element minOccurs="0" maxOccurs="1" form="unqualified" name="Return_Msg" type="s:string" />
          </s:sequence>
          <s:attribute name="Item_No" type="s:string" />
        </s:complexType>
      </s:element>
      <s:element name="getItemInfoRequest" type="tns:GetItemInfoType" />
      <s:complexType name="GetItemInfoType">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" form="unqualified" name="ItemNumber" type="s:string" />
          <s:element minOccurs="1" maxOccurs="1" form="unqualified" name="IncludeStandardInfo" type="s:boolean" />
          <s:element minOccurs="1" maxOccurs="1" form="unqualified" name="IncludeTrackAndTraceEvent" type="s:boolean" />
          <s:element minOccurs="1" maxOccurs="1" form="unqualified" name="IncludeArchiveDataBase" nillable="true" type="s:boolean" />
        </s:sequence>
      </s:complexType>
      <s:element name="getItemInfoResponse" type="s:string" />
    </s:schema>
  </wsdl:types>
  <wsdl:message name="getCompleteItemNumberSoapIn">
    <wsdl:part name="getCompleteItemNumberRequest" element="tns:getCompleteItemNumberRequest" />
  </wsdl:message>
  <wsdl:message name="getCompleteItemNumberSoapOut">
    <wsdl:part name="getCompleteItemNumberResult" element="tns:getCompleteItemNumberResponse" />
  </wsdl:message>
  <wsdl:message name="listPostOfficesSoapIn">
    <wsdl:part name="ListPostOfficeRequest" element="tns:ListPostOfficeRequest" />
  </wsdl:message>
  <wsdl:message name="listPostOfficesSoapOut">
    <wsdl:part name="listPostOfficesResult" element="tns:ListPostOfficesResponse" />
  </wsdl:message>
  <wsdl:message name="validationPriorCaseCreationSoapIn">
    <wsdl:part name="ValidationPriorCaseCreationRequest" element="tns:ValidationPriorCaseCreationRequest" />
  </wsdl:message>
  <wsdl:message name="validationPriorCaseCreationSoapOut">
    <wsdl:part name="validationPriorCaseCreationResult" element="tns:ValidationPriorCaseCreationResponse" />
  </wsdl:message>
  <wsdl:message name="getItemInfoSoapIn">
    <wsdl:part name="getItemInfoRequest" element="tns:getItemInfoRequest" />
  </wsdl:message>
  <wsdl:message name="getItemInfoSoapOut">
    <wsdl:part name="getItemInfoResult" element="tns:getItemInfoResponse" />
  </wsdl:message>
  <wsdl:portType name="PMItemAndLocationEnquirySoap">
    <wsdl:operation name="getCompleteItemNumber">
      <wsdl:input message="tns:getCompleteItemNumberSoapIn" />
      <wsdl:output message="tns:getCompleteItemNumberSoapOut" />
    </wsdl:operation>
    <wsdl:operation name="listPostOffices">
      <wsdl:input message="tns:listPostOfficesSoapIn" />
      <wsdl:output message="tns:listPostOfficesSoapOut" />
    </wsdl:operation>
    <wsdl:operation name="validationPriorCaseCreation">
      <wsdl:input message="tns:validationPriorCaseCreationSoapIn" />
      <wsdl:output message="tns:validationPriorCaseCreationSoapOut" />
    </wsdl:operation>
    <wsdl:operation name="getItemInfo">
      <wsdl:input message="tns:getItemInfoSoapIn" />
      <wsdl:output message="tns:getItemInfoSoapOut" />
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="PMItemAndLocationEnquirySoap" type="tns:PMItemAndLocationEnquirySoap">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
    <wsdl:operation name="getCompleteItemNumber">
      <soap:operation soapAction="http://www.proiam.com/PMItemAndLocationEnquiry/getCompleteItemNumber" style="document" />
      <wsdl:input>
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="listPostOffices">
      <soap:operation soapAction="http://www.proiam.com/PMItemAndLocationEnquiry/listPostOffices" style="document" />
      <wsdl:input>
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="validationPriorCaseCreation">
      <soap:operation soapAction="http://www.proiam.com/PMItemAndLocationEnquiry/validationPriorCaseCreation" style="document" />
      <wsdl:input>
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="getItemInfo">
      <soap:operation soapAction="http://www.proiam.com/PMItemAndLocationEnquiry/getItemInfo" style="document" />
      <wsdl:input>
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="PMItemAndLocationEnquiry">
    <wsdl:port name="PMItemAndLocationEnquirySoap" binding="tns:PMItemAndLocationEnquirySoap">
      <soap:address location="http://localhost:57919/PMItemAndLocationEnquiry.asmx" />
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>

Problem when adding validation for WCF

$
0
0

I created a very simple WCF service library and then a WCF service application.  I was able to deploy the app to IIS on a server.  The URL to the .svc was accessible through my browser and I even created a Windows console application to test calling the web service from code.  Everything worked just fine.  But, I need to add authentication with a username/password.  I did some research and found an example that had me create a new class that inherited from UserNamePasswordValidator and then made changes to my web.config.  After testing everything locally I tried deploying the app to the server again.  This time the URL to the .svc would not resolve.  And my command line application gives me a strange error saying :

"Client found response content type of '', but expected 'text/xml'.".

Below is the web.config with the changes I made for the authentication commented out:

<?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><!--<services><service name="ServiceLib.HelloService" behaviorConfiguration="ServicesBehavior"><endpoint address="" binding="wsHttpBinding" contract="ServiceLib.IHelloService" bindingConfiguration="ServicesConfig"></endpoint></service></services><bindings><wsHttpBinding><binding name="ServicesConfig"><security mode="Message"><message clientCredentialType="UserName"/></security></binding></wsHttpBinding></bindings>
    --><behaviors><serviceBehaviors><behavior><!--<behavior name="ServicesBehavior">--><serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/><serviceDebug includeExceptionDetailInFaults="false"/><!--<serviceCredentials><clientCertificate><authentication certificateValidationMode="None" /></clientCertificate><userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="ServiceLib.ServiceAuthenticator,ServiceLib" /><serviceCertificate findValue="Services" x509FindType="FindBySubjectName" storeName="My" storeLocation="CurrentUser" /></serviceCredentials>
          --></behavior></serviceBehaviors></behaviors><protocolMapping><add binding="basicHttpsBinding" scheme="https" /></protocolMapping><serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /></system.serviceModel><system.webServer><modules runAllManagedModulesForAllRequests="true"/><directoryBrowse enabled="true"/></system.webServer></configuration>

Using the web.config with everything regarding the authentication commented out I can get my web service to work again, but I need to have username/password authentication.

Any help would be greatly appreciated.

Call webservice that uses header authentication with jQuery

$
0
0

Hello,

I created a webservice, and I am protecting access to the methods by using a soap header like this one:

public class MyWebService : System.Web.Services.WebService
    {
		// ....
        public UserDetails userDetails;
       [WebMethod]
        [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
        [SoapHeader("userDetails")]
        public string GetItemById(int Id)
        {
            if (userDetails != null && userDetails.IsValid())
            {
                Item item = getItem();
                return new JavaScriptSerializer().Serialize(item);
            }
            else throw new Exception("Authentication failed");
        }
		//...
}

  public class UserDetails : System.Web.Services.Protocols.SoapHeader
    {
        public string userName { get; set; }
        public string password { get; set; }

        public bool IsValid()
        {
            return this.userName == "name" && this.password == "1234";
        }
    }

Now I want to call that webservice from Jquery. from the unprotected methods it works all right, but in that protected method there is something wrong: the header is always null, therefore the authentication fails always.

I think I must be doing something wrong in the way I send the data to the webservice when I do the JQuery call. I put this code together after reading varios post in internet about how to send headers to a webservice, but obviously I am missing something:

$("#Test").click(function () {

        var soapXML =
            "<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/'>" +"  <soap:Header>" +"<UserDetails xmlns='http://tempuri.org/'>" +"<Username>test</Username>" +"<Password>1234</Password>" +"</UserDetails>" +"</soap:Header>" +"<soap:Body>" +"<GetItemById xmlns='http://tempuri.org/' />" +"</soap:Body>" +"</soap:Envelope>";$.ajax({
            url: "http://localhost:2232/MyWebService.asmx/GetItemById",
            type: "POST",
            dataType: "xml",
            contentType: "text/xml; charset=utf-8",
            data: soapXML,
            beforeSend: function (xhr) {
                xhr.setRequestHeader('SOAPAction', 'http://localhost:2232/MyWebService/GetItemById');
            },

            success: function (data) {
                console.log(data);
            },
            error: function (err) {
                console.log(err);
            }
        });
    });

Could anybody indicate me how to properly send the data to the webservice?

Also, all the examples I found in the internet tell me to create that XML string to send the headers data. When I do not use the authentication I can send the data to the server like this:

data:"{Id:123}"

Which is way easier to read than the XML. I have also prepared the service to return data in the JSON format. There is a way to send that Soap headers data, in the same way as the parameters of the function (as a JSON)? 

Thanks for your help.

System.InvalidOperationException: Client found response content type of '', but expected 'text/xml'.

$
0
0

Hi All,

I encountered an issue regarding invoke an ASMX web service which always return empty content to me.

The background is here.

The ASMX web service is OK. I can confirm it. This web service is hosted in IIS 5 or 6 in Windows Server 2003. It works well.

Recently, I moved this web service to IIS 10 on Windows Server 2016. I have installed related .NET Framework 3.5 and 4.6 features. Such as HTTP Activation/Non-HTTP Activation/TCP Activation/TCP Port Sharing.

I mapped the web service website to multiple URL. For example, we can access it throughhttp://ws.xxxx.com/webservice/xxx.asmx

http://wsxxx/webservice/xxx.asxm

https://ws.xxx.com/webservice/xxx.asmx

The strange issue is that I can access the web service through http://ws.xxxx.com/webservice/xxx.asmx. When I tested them via web browser.  It return the correct response with text/xml. But for the others, it returned an empty page.

In my view, it’s a configuration issue related IIS. But I didn’t figure out. Could you please help to take a look at this issue? And give your suggestions to me.

Thank YOU.

Using smart card for client authentication to SOAP service

$
0
0

We have a client application that communicates with a SOAP service that requires mutual authentication. Our customer uses a certificate and private key from a smart card to access the SOAP service and have been using it without a problem in Windows 7 for some time now. They have recently upgraded to Windows 10 and the smart card authentication no longer works. The first attempt to access the SOAP service works fine but all subsequent requests to the SOAP service fail with "Could not create SSL/TLS secure channel"

The client application uses the standard auto generated SOAP classes and we add the client certificate to the list of client certificates in SoapHttpClientProtocol.

Please help!


Need Web Service help for calling a method when XML incoming from external source

$
0
0

First - I must apologize - I have not worked in web development in 8.5 years. I have been working in software development and have never build a web service.

I am running a vb/asp.net 4.5 environment web server.

When setting up the server and to make sure I could get a web service to work, I used the Fahrenheit to Celsius TempConvert and debugged the web config file to make sure everything is working. (http://sierraproductioncenter.com/WebForm1.aspx)

We have an outside vendor who wants to send us XML files to be consumed on our side so I can parse them and feed our DB. My thought on this is I should just need to save the incoming file onto the web server to a file.  I can then loop through the files, validate, and feed data to the SQL DB.

After poking around for 2 days, I found some code that looks like I should be able to save a file to a TempFileName.

<WebMethod()> Public Function GetTempFileName() As String
        Dim g As Guid = New Guid
        Dim fs As FileStream = New FileStream(Server.MapPath(g.ToString()), FileMode.Create)
        fs.Close()

        Return g.ToString()
    End Function

    <WebMethod()> Public Sub AppendToTempFile(ByVal filename As String, ByVal data As Byte)
        Try
            Dim fs As FileStream = New FileStream(Server.MapPath(filename), FileMode.Append)
            Dim bw As BinaryWriter = New BinaryWriter(fs)
            bw.Write(data)
            bw.Close()
            fs.Close()

        Catch ex As Exception
            Throw New Exception("Append to TempFile " + ex.ToString)
        End Try

    End Sub

The issue is - how do I call the method(s) without creating a form action/button on an .aspx?

In theory, shouldn't they be able to send to a web address or does it need to have some kind of form action?

Read large binary file into byte array - File.ReadAllBytes throws 'System.OutOfMemoryException'

$
0
0

Running on Windows Server 2003, IIS 6.0, Visual Studio 2010, .Net Framework 3.5

The web service is throwing a "System.OutOfMemoryException" whenever it tries to read a file large binary file (> 80 Meg).

To make troubleshooting this issue easier, I have separated out the code into a simple web service with only one call
GetByteArrayFromFile which reads a file and returns a byte array.

It consistently throws the 'Out of Memory' exception with files larger than 80 Meg.

Are there any steps I can take to resolve this issue?

'**********************************************************
'Web Service Call
Imports System.Web.Services, System.Web.Services.Protocols, System.ComponentModel

<System.Web.Services.WebService(Description:="Testing", _    
  Namespace:="http://Testing.org/")> _
  <System.Web.Services.WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
  <ToolboxItem(False)> _
Public Class ProcSvcs   Inherits System.Web.Services.WebService

<WebMethod(Description:="Byte array from File")> _  
Public Function GetByteArrayFromFile(ByVal PathFName As String) As Byte()    
Try      
  Dim Content() As Byte = System.IO.File.ReadAllBytes(path:=PathFName)      
  Return Content    
Catch ex As Exception      
   Throw New Exception(ex.Message)    
End Try  
End Function

End Class

 

Problem when opening in new version

$
0
0

Hi,

One my project was developed in VS 2003 and .NET framework 1.0. Now we have VS 2005 and I am trying to open the project it is asking me to convert project to later version.

Then my entire project structure was changed all my code file (Eg. webservice.asmx.VB) moved to folder App_code.

Below are the lines from conversion report

Added folder App_Code.
Moved file webservice.asmx.vb to the App_Code\ directory

Moved file Global.asax.vb to the App_Code\ directory

Before conversion those files are in root folder (directly under solution)

Now the problem is when I published the project DLL is not generating in the name of application. It generated in name App_Code. I believe my code moved to App_Code folder DLL generated on this name.

Now what I want is project structure shouldn't get changed though it changed I want DLL in name of application name.

Kindly helpful on this.

Could not find part of Path when trying to test a Web Service

$
0
0

I have a web service where I need to have a third party transmit XML docs to a folder on our web server.  After much pounding on permissions, I can finally path to a folder at https://sierraproductioncenter.com/Hyphen/In/Order/  however the service is throwing an error that the folder path cannot be found.  If I copy and paste the path in an explorer window on web server it resolves to correct folder. 

Could not find a part of the path 'C:\inetpub\vhosts\sierraproductioncenter.com\HTTPDOCS\Hyphen\In\Order\'.

I even threw directory code in just in case the directory was reading some alternative location - but no.  What is wrong? 

WEB SERVICE:

Imports System
Imports System.IO
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.ComponentModel

' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
<System.Web.Script.Services.ScriptService()><System.Web.Services.WebService(Namespace:="https://sierraproductioncenter.com/")><System.Web.Services.WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _<ToolboxItem(False)> _
Public Class WebService1
    Inherits System.Web.Services.WebService<WebMethod()>
    Public Function SaveDocument(ByVal docbinaryarray As Byte, ByVal docname As String) As Boolean
        Dim docPath As String = Server.MapPath("~\Hyphen\In\Order\")
        Dim strdocPath As String = Server.MapPath("~\Hyphen\In\Order\") + docname

        If Directory.Exists(docPath) = False Then
            Directory.CreateDirectory(docPath)
        End If

        Dim objfilestream As FileStream = New FileStream(strdocPath, FileMode.Create, FileAccess.ReadWrite)
        Dim bw As BinaryWriter = New BinaryWriter(objfilestream)
        bw.Write(docbinaryarray)
        bw.Close()
        objfilestream.Close()

        Return True
    End Function


WEB SERVICE CALL:

Imports System.IO

Public Class DocumentService
    Inherits System.Web.UI.Page

    Dim sfile As String = Server.MapPath("~\Hyphen\In\Order\")

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Directory.Exists(sfile) = False Then
            Directory.CreateDirectory(sfile)
        End If
    End Sub

    Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim objfilestream As FileStream = New FileStream(sfile, FileMode.Open, FileAccess.Read)
        Dim len As Integer = CType(objfilestream.Length, Integer)
        Dim mybytearray() As Byte = New Byte(len) {}
        Dim myservice As localhost.WebService1 = New localhost.WebService1()

        objfilestream.Read(mybytearray, 0, len)
        myservice.SaveDocument(mybytearray(len), sfile)
        objfilestream.Close()

    End Sub

Webservice response not getting assigned

$
0
0

Techies,

I am calling a third party Guidewire Webservice in a C# windows application. I am having an issue where the response object/variables are always null even though i get the response logged in trace file. Also i see the response in SOAP UI.

I have tried many different approaches here, but for some reason the response wont be assigned to output variables.

I tried adding it as Service Reference with no luck.

I tired generating proxy class files using SVCUtil and WSDL.exe, still no luck.

I verified all the request and response headers to see if there is any mismatch and it seems to be matching. i am not sure why the responses wont get assigned to output variable.

Trace file doesn't have any errors.. Can you please help on how we can proceed on this?

Any pointers will be appreciated.

Thank You!

Viewing all 555 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>