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

Error trying to consume SOAP webservice

$
0
0

Hello,

 I am getting the following error when trying to receive a products list from a SOAP webservice. The code and error details are as follows. It seems there is an error when deserializing the xml response. Is there a configuration that needs to be done or other solution? Thanks a lot for your help.

private

voidGetProducts1(stringlogin,stringpassword)

        {

            WebReference2.WebServicesDolibarrProductOrService client =

newWebReference2.WebServicesDolibarrProductOrService();

            WebReference2.authentication authentication =

newWebReference2.authentication();

            authentication.login = login;

            authentication.password = password;

            WebReference2.ProductsArray2 products1;

            WebReference2.filterproduct fp =

newWebReference2.filterproduct();

            client.getListOfProductsOrServices(authentication, fp,

outproducts1);

        }

The error is as follows:

System.InvalidOperationException
  HResult=0x80131509
  Message=There is an error in XML document (1, 750).
  Source=System.Xml
  StackTrace:
   at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at Consumewebservice.WebReference2.WebServicesDolibarrProductOrService.getListOfProductsOrServices(authentication authentication, filterproduct filterproduct, ProductsArray2& products) in

Inner Exception 1:
InvalidOperationException: The specified type was not recognized: name=':', namespace='', at <products xmlns=''>.


Redirect request to another endpoint

$
0
0

I have 2 endpoints that read XML from the request body.

APInvoices

ARInvoices

I need to create another endpoint, call it PostInvoices, that reads the same XML and queries some values and redirects the query to either ARInvoices or APInvoices. Each of the two endpoints respond with XML output which I'd need to pick up and respond back to PostInvoices.

Is that something that is simple to do? Haven't found anything useful on the web about it but then it's hard asking the right questions sometimes, if you don't know the right terms.

Keep getting "The located assembly's manifest definition does not match the assembly reference." when starting a new Web API project

$
0
0

In the last few months I've started 3 new Web API projects. Each of these are meant to hit against an ADFS server we have in-house for development. Every time I do, before I start programming anything I build and run it to see if it works. It always fails we ah error that says:

"Could not load file or assembly 'Microsoft.IdentityModel.Protocols.WsFederation, Version=5.2.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)"

I found an post on Stack Overflow on this, which I thought would handle it, but now it doesn't. It's very strange how just starting a new project, putting in other the information required for ADFS, then trying to run it consistently fails. And it bothers me that what did work a few months ago (I asked a question in that post back in June now doesn't work at all. My guess is that something is changing when new updates to Visual Studio 2017 come out, which breaks compatibility with whatever assemblies is depending upon 'Microsoft.IdentityModel.Protocols.WsFederation.

Anyway, here's the full text of the error I'm getting:

System.IO.FileLoadException
HResult=0x80131040
Message=Could not load file or assembly 'Microsoft.IdentityModel.Protocols.WsFederation, Version=5.2.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Source=Microsoft.Owin.Security.ActiveDirectory
StackTrace:
at Microsoft.Owin.Security.ActiveDirectory.WsFedMetadataRetriever.GetSigningKeys(String metadataEndpoint, TimeSpan backchannelTimeout, HttpMessageHandler backchannelHttpHandler)
at Microsoft.Owin.Security.ActiveDirectory.WsFedCachingSecurityKeyProvider.RetrieveMetadata()
at Microsoft.Owin.Security.ActiveDirectory.WsFedCachingSecurityKeyProvider..ctor(String metadataEndpoint, ICertificateValidator backchannelCertificateValidator, TimeSpan backchannelTimeout, HttpMessageHandler backchannelHttpHandler)
at Owin.ActiveDirectoryFederationServicesBearerAuthenticationExtensions.UseActiveDirectoryFederationServicesBearerAuthentication(IAppBuilder app, ActiveDirectoryFederationServicesBearerAuthenticationOptions options)
at MiniCoreWebAPI.Startup.ConfigureAuth(IAppBuilder app) in D:\Src\MiniCoreWebAPI\MiniCoreWebAPI\App_Start\Startup.Auth.cs:line 18
at MiniCoreWebAPI.Startup.Configuration(IAppBuilder app) in D:\Src\MiniCoreWebAPI\MiniCoreWebAPI\Startup.cs:line 9

Inner Exception 1:
FileLoadException: Could not load file or assembly 'Microsoft.IdentityModel.Protocols.WsFederation, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

And here's what I believe is the relevant section from the Web.Config file:

<runtime><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="Microsoft.IdentityModel.Protocols.WsFederation" publicKeyToken="31BF3856AD364E35" culture="neutral" /><bindingRedirect oldVersion="0.0.0.0-5.2.1.0" newVersion="5.2.1.0" /></dependentAssembly><dependentAssembly><assemblyIdentity name="Microsoft.IdentityModel.Tokens.Saml" publicKeyToken="31BF3856AD364E35" culture="neutral" /><bindingRedirect oldVersion="0.0.0.0-5.2.1.0" newVersion="5.2.1.0" /></dependentAssembly><dependentAssembly><assemblyIdentity name="Microsoft.IdentityModel.Tokens" publicKeyToken="31bf3856ad364e35" /><bindingRedirect oldVersion="0.0.0.0-5.2.4.0" newVersion="5.2.4.0" /></dependentAssembly><dependentAssembly><assemblyIdentity name="Microsoft.IdentityModel.Protocols.OpenIdConnect" publicKeyToken="31bf3856ad364e35" /><bindingRedirect oldVersion="0.0.0.0-5.2.1.0" newVersion="5.2.1.0" /></dependentAssembly><dependentAssembly><assemblyIdentity name="Microsoft.IdentityModel.Protocols" publicKeyToken="31bf3856ad364e35" /><bindingRedirect oldVersion="0.0.0.0-5.2.1.0" newVersion="5.2.1.0" /></dependentAssembly><dependentAssembly><assemblyIdentity name="System.IdentityModel.Tokens.Jwt" publicKeyToken="31bf3856ad364e35" /><bindingRedirect oldVersion="0.0.0.0-5.2.1.0" newVersion="5.2.1.0" /></dependentAssembly><dependentAssembly><assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f" /><bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2" /></dependentAssembly><dependentAssembly><assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" /><bindingRedirect oldVersion="0.0.0.0-4.0.2.1" newVersion="4.0.2.1" /></dependentAssembly><dependentAssembly><assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35" /><bindingRedirect oldVersion="0.0.0.0-1.1.0.0" newVersion="1.1.0.0" /></dependentAssembly><dependentAssembly><assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" /><bindingRedirect oldVersion="0.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930" /></dependentAssembly><dependentAssembly><assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" /><bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0" /></dependentAssembly><dependentAssembly><assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" /><bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" /></dependentAssembly><dependentAssembly><assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" /><bindingRedirect oldVersion="0.0.0.0-5.2.4.0" newVersion="5.2.4.0" /></dependentAssembly><dependentAssembly><assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" /><bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" /></dependentAssembly><dependentAssembly><assemblyIdentity name="Microsoft.IdentityModel.Xml" publicKeyToken="31bf3856ad364e35" culture="neutral" /><bindingRedirect oldVersion="0.0.0.0-5.2.1.0" newVersion="5.2.1.0" /></dependentAssembly><dependentAssembly><assemblyIdentity name="Microsoft.IdentityModel.Logging" publicKeyToken="31bf3856ad364e35" culture="neutral" /><bindingRedirect oldVersion="0.0.0.0-5.2.4.0" newVersion="5.2.4.0" /></dependentAssembly><dependentAssembly><assemblyIdentity name="Microsoft.IdentityModel.Protocols.WsFederation" publicKeyToken="31bf3856ad364e35" culture="neutral" /><bindingRedirect oldVersion="0.0.0.0-5.2.4.0" newVersion="5.2.4.0" /></dependentAssembly></assemblyBinding></runtime>

Note that there are 2 sections in the above related to Microsoft.IdentityModel.Protocols.WsFederation. I'm not entirely sure how come that is, but I'm thinking this may now have something to do with my problem. When I first got the error I tried install the NuGet package Microsoft.IdentityModel.Protocols.WsFederation for version 5.2.0.0. But that seemed only to cause another problem, or at least not address the issue I was having. So I went to remove it, but that didn't work. However the Manage NuGet Packages... in VS 2017 did allow me to upgrade from 5.2.0.0 to 5.2.4.0, so I went ahead and did that. I think that might be why there's that second entry in the Web.Config file. Not entirely sure I'm correct about that. If I am, why didn't the upgrade remove the older version? At the end of the day, I need to know why this is failing again and how to remedy it. And for that matter, I'd like to know how to stop getting this every time I create a new Web API?

How to pass cookies from WCF to MVC application

$
0
0

Hi,

I have a requirement to send secured cookies from WCF to MVC application.

I have 2 WCF application; WCF1 is in house service and WCF2 is an external service.  I am consuming WCF2 service in WCF1;  WCF2 returns data along with secured cookies to WCF1.  I want to send this secured cookies from WCF1 to my mvc application (MVC application consumes WCF1 service)

how can I pass the secured cookies from WCF2 to mvc application via WCF1?

Thanks

Selvakumar R

HTTP Post to Web Service containing a file

$
0
0

My understanding of web services is at best ok. In principle it is calling a function across the web to gain a service and get a response. I've had some awesome help from someone on this forum in getting the HTTP post containing XML to work, and it does. This might be a dumb question, but when doing a web service call and passing in XML in the body, is it possible to send the XML as a file rather than in the body? To me it doesn't make a great deal of sense doing it that way but the question has been asked today so I thought I'd post the query on here.

Nested WCF service calls get stuck in IIS

$
0
0
<div class="votecell post-layout--left"> <div class="vote">I have a case where I have to send calls to other service methods from a service method. e.g. I call a service method A.Call1() from my smart client application, then after some operations it sends call to B.Call2() and then Call2 method sends call to C.Call3().</div> </div> <div class="postcell post-layout--right"> <div class="post-text" itemprop="text">

When I send few concurrent hits to A.Call1() then all service methods stuck in IIS most of times and times out, anyone suggest a fix or better design.

I'm using simple HttpBinding, 4.6 .Net Framework with IIS 8.5 and using default throttling settings.

</div> </div>

Create web services in web or in xamarin?

$
0
0

Hi, if i am to create web and app which call the same web api, my web api layer to be created in the web application or in the mobile application?

WCF issue after upgrading from MDS 2012 to MDS 2016

$
0
0

Hi.

I have web service that consumes MDS WCF and enables methods to insert , update entities for the MDS model. Recently we upgraded from MDS 2012 to MDS 2016. Now when we try to run the web service, we get the below error message -

"The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://schemas.microsoft.com/sqlserver/masterdataservices/2009/09:EntityMembers. The InnerException message was 'Invalid enum value 'Access' cannot be deserialized into type 'mymdswcfservice.SecurityPermission'. Ensure that the necessary enum values are present and are marked with EnumMemberAttribute attribute if the type has DataContractAttribute attribute.'.

We have tried to debug this error, but its getting generated at one of MDS WCF methods - 'EntityMembersGet' and unable to debug this MDS WCF method. Also tried to disable service configuration 'Reuse Type in referenced assembles', but it did not help.

How to fix this?

Thanks


The remote server returned an error: (415) Unsupported Media Type.

$
0
0

Dear all,

I am developing a wcf service which will send XML to a service outside my office.
Following is my code


Dim xml As String
xml = "http://send/p1/?xml=<?xml version=""1.0"" encoding=""utf-8""?>" +
"<Emp ID=""1234"">" +
"<EmpDtls>" +
"<Empno>" & Empno & "</empno>" +
"</EmpDtls>" +
"</Emp>"
Dim url As String = "http://send/p1"
Dim req As HttpWebRequest = DirectCast(WebRequest.Create(url), HttpWebRequest)
Dim requestBytes As Byte() = System.Text.Encoding.ASCII.GetBytes(xml)
req.Method = "POST"
req.ContentType = "text/xml;charset=utf-8"
req.ContentLength = requestBytes.Length
Dim requestStream As Stream = req.GetRequestStream()
requestStream.Write(requestBytes, 0, requestBytes.Length)
requestStream.Close()
Dim res As HttpWebResponse = DirectCast(req.GetResponse(), HttpWebResponse)
If res.StatusCode = HttpStatusCode.OK Then

End If
Dim sr As New StreamReader(res.GetResponseStream(), System.Text.Encoding.[Default])
Dim backstr As String = sr.ReadToEnd()
sr.Close()
res.Close()

I am getting following error message. Please help me to rectify this issue.
The remote server returned an error: (415) Unsupported Media Type.

Web.config
<system.net>
<defaultProxy>
<proxy usesystemdefault="False"/>
</defaultProxy>
</system.net>

<system.web>
<compilation debug="true" strict="false" explicit="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="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>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>

Thanks
nick

Need a work through on creating a web service

$
0
0

I have a vb.net Ultimate, I have tried to create a web service, I am just wondering if some could give me a work through. Or  point me to a tutorial. Thanks

Authentication failure of Compatibility Provider for Security (SSPI)

$
0
0

Hi

I have a wcf service.

I receive an error when I call a method:

Authentication failure of Compatibility Provider for Security (SSPI). It is possible that the server is not running on an account with the identity 'host / gppesvlcli1205.gp.inet'. If the server is running on a service account (as a network service), specify ServicePrincipalName as the server's EndpointAddress identity. If the server is running on a user account, specify the UserPrincipalName of the account as the server's EndpointAddress identity.

My web config:

<?xml version="1.0" encoding="utf-8"?><!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  --><configuration><connectionStrings><add name="SDioDbConnectionString" connectionString="Data Source=10.4.40.131\EDI_DESA;Initial Catalog=DIO;User ID=user_oportunidad; Password=Tgest123456&amp;&amp;; MultipleActiveResultSets=True;App=SDioContext" providerName="System.Data.SqlClient" /></connectionStrings><!--
    For a description of web.config changes see http://go.microsoft.com/fwlink/?LinkId=235367.

    The following attributes can be set on the <httpRuntime> tag.<system.Web><httpRuntime targetFramework="4.5" /></system.Web>
  --><system.web><compilation targetFramework="4.5" strict="false" explicit="true"/><httpRuntime targetFramework="4.5" maxRequestLength="51200" executionTimeout="120" /><trace enabled="false" pageOutput="false" /></system.web><system.serviceModel><extensions><behaviorExtensions><add name="error" type="Tgs.SDIO.AL.Host.Utils.ErrorBehavior, Tgs.SDIO.AL.Host" /></behaviorExtensions></extensions><services><service name="Tgs.SDIO.AL.Servicios.Implementacion.Comun.ServicioComunSDio" behaviorConfiguration="BehaviorServicio"><endpoint binding="wsHttpBinding" contract="Tgs.SDIO.AL.Servicios.Interfaces.Comun.IServicioComunSDio" /></service><service name="Tgs.SDIO.AL.Servicios.Implementacion.Seguridad.ServicioSeguridadSDio" behaviorConfiguration="BehaviorServicio"><endpoint binding="wsHttpBinding" contract="Tgs.SDIO.AL.Servicios.Interfaces.Seguridad.IServicioSeguridadSDio" /></service><service name="Tgs.SDIO.AL.Servicios.Implementacion.Trazabilidad.ServicioTrazabilidadSDio" behaviorConfiguration="BehaviorServicio"><endpoint binding="wsHttpBinding" contract="Tgs.SDIO.AL.Servicios.Interfaces.Trazabilidad.IServicioTrazabilidadSDio"/></service><service name="Tgs.SDIO.AL.Servicios.Implementacion.Oportunidad.ServicioOportunidadSDio" behaviorConfiguration="BehaviorServicio"><endpoint binding="wsHttpBinding" contract="Tgs.SDIO.AL.Servicios.Interfaces.Oportunidad.IServicioOportunidadSDio"/></service></services><bindings><wsHttpBinding><binding maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647" closeTimeout="00:30:00" openTimeout="00:30:00" receiveTimeout="00:30:00" sendTimeout="00:30:00" messageEncoding="Text"><readerQuotas maxDepth="2000000" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /></binding></wsHttpBinding><basicHttpBinding><binding name="basicHttp" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" maxBufferPoolSize="2147483647"><readerQuotas maxArrayLength="2147483647" maxNameTableCharCount="2147483647" maxStringContentLength="2147483647" maxDepth="2147483647" maxBytesPerRead="2147483647" /></binding><binding name="RAIS_AccesoSoap" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" maxBufferPoolSize="2147483647"><readerQuotas maxArrayLength="2147483647" maxNameTableCharCount="2147483647" maxStringContentLength="2147483647" maxDepth="2147483647" maxBytesPerRead="2147483647" /></binding><binding name="RAIS_UsuarioSoap" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" maxBufferPoolSize="2147483647"><readerQuotas maxArrayLength="2147483647" maxNameTableCharCount="2147483647" maxStringContentLength="2147483647" maxDepth="2147483647" maxBytesPerRead="2147483647" /></binding></basicHttpBinding></bindings><client><endpoint address="http://gppesvlcli1204/RAIS_sdio_WS/RAIS_AccesoSistema.asmx" binding="basicHttpBinding" bindingConfiguration="RAIS_AccesoSoap" contract="WsRaisAccesoSistema.RAIS_AccesoSoap" name="RAIS_AccesoSoap" /><endpoint address="http://gppesvlcli1204/RAIS_sdio_WS/RAIS_Usuario.asmx" binding="basicHttpBinding" bindingConfiguration="RAIS_UsuarioSoap" contract="WsRaisUsuario.RAIS_UsuarioSoap" name="RAIS_UsuarioSoap" /></client><behaviors><serviceBehaviors><behavior name="BehaviorServicio"><!-- Para evitar revelar información de los metadatos, establezca los valores siguientes en false antes de la implementación --><serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" /><!-- Para recibir detalles de las excepciones en los fallos, con el fin de poder realizar la depuración, establezca el valor siguiente en true. Para no revelar información sobre las excepciones, establézcalo en false antes de la implementación --><serviceDebug includeExceptionDetailInFaults="true" /><serviceThrottling maxConcurrentCalls="1000" maxConcurrentInstances="1000" maxConcurrentSessions="1000" /><error nombre="ServicioErrores" habilitado="True" ruta="${basedir}/LogErrores" /></behavior></serviceBehaviors></behaviors><protocolMapping><add binding="basicHttpsBinding" scheme="https" /></protocolMapping><serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"><serviceActivations><add relativeAddress="ServicioComunSDio.svc" factory="SimpleInjector.Integration.Wcf.SimpleInjectorServiceHostFactory, SimpleInjector.Integration.Wcf" service="Tgs.SDIO.AL.Servicios.Implementacion.Comun.ServicioComunSDio" /><add relativeAddress="ServicioSeguridadSDio.svc" factory="SimpleInjector.Integration.Wcf.SimpleInjectorServiceHostFactory, SimpleInjector.Integration.Wcf" service="Tgs.SDIO.AL.Servicios.Implementacion.Seguridad.ServicioSeguridadSDio" /><add relativeAddress="ServicioTrazabilidadSDio.svc" factory="SimpleInjector.Integration.Wcf.SimpleInjectorServiceHostFactory, SimpleInjector.Integration.Wcf" service="Tgs.SDIO.AL.Servicios.Implementacion.Trazabilidad.ServicioTrazabilidadSDio"/><add relativeAddress="ServicioOportunidadSDio.svc" factory="SimpleInjector.Integration.Wcf.SimpleInjectorServiceHostFactory, SimpleInjector.Integration.Wcf" service="Tgs.SDIO.AL.Servicios.Implementacion.Oportunidad.ServicioOportunidadSDio"/></serviceActivations></serviceHostingEnvironment></system.serviceModel><appSettings><add key="CodigoAplicacion" value="SDIO"/><add key="IdSistema" value=""/><add key="CodigoEmpresa" value="1"/><add key="CorreoSalida" value="sdio@tgestiona.com.pe"/><add key="NombreSistemaCorreoSalida" value="SDIO"/><add key="SmtpServer" value="172.28.11.30" /><add key="SmtpPort" value="25" /></appSettings><system.webServer><modules runAllManagedModulesForAllRequests="true" /><!--
        Para examinar el directorio raíz de la aplicación web durante la depuración, establezca el valor siguiente en true.
        Establézcalo en false antes de la implementación para evitar revelar información sobre la carpeta de aplicación web.
      --><directoryBrowse enabled="true" /></system.webServer><runtime><gcServer enabled="true" /></runtime></configuration>

How to solve HTTP Error 403.14 - Forbidden error in web service project

$
0
0

I a new to web service project . I'm getting HTTP Error 403.14 - Forbidden whenever I debug my project . It says

HTTP Error 403.14 - Forbidden The Web server is configured to not list the contents of this directory.

to enable directory but it's not going to work . How to solve this error? Please Help? Any clue will be helpful .

WCF: The caller was not authenticated by the service

$
0
0

Dear Experts,

                  i am facing an error that is answered already but i tested almost all solutions i found but could not resolve it so i thought i should provide my scenario to get the exact solution.

i am using wshttpbinding to create the WCF service that i tested in my machine; it is working as expected. then i deployed it in another (two) machines
to test it as production environment but start getting error, "The caller was not authenticated by the service" on every service call. i tested it in Windows 8 and Windows Server 2008.

i tested Security type "None" and "Message" but could get this issue resolved.

i want to use Messaage security type. please guide me the exact step by step ways that i should use to avoid this error. changes in like
config file setting for client and server, IIS settings, pool settings, Windows settings on client and server etc. [that are using this service]

i believe the already available solutions are not enough and lack some settings somewhere discussed above.
please help me as i am almost stuck here and i need to give the solution as soon as possible.


with many thanks

Response message of BasicHttpBinding and WsHttpBinding (Encryption)

$
0
0

Hi

I read in https://www.codeproject.com/Articles/36396/Difference-between-BasicHttpBinding-and-WsHttpBind that in WsHttpBindingthe data is not sent in plain text such as in BasicHttpBinding

I have an Error.svclog file : https://drive.google.com/open?id=1ug-k2bp-bP2Y4VnTraBzIfqkpkJ4Iaal

I don't identify where I can see the encrypted data in BasicHttpBinding and WsHttpBinding

In case of basichttpbinding: I see the message:

https://drive.google.com/open?id=1nCTQeQZplTL5M0tYSkuV8aiSHRQON9WU

I case of WsHttpBinding :

https://drive.google.com/open?id=1lLD_jOnkoImnnjjGzYjkdV014oLLdHrg

how to format the response message of web api post method

$
0
0

Dear all,

How can I format the response message of web api post method?

public async System.Threading.Tasks.Task<EmpResponse> SendEmpDetails(EmpRequest request)
{


double Code = request.Code;


client.BaseAddress = new Uri("http://");
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
EmpResponse res = new EmpResponse();


HttpResponseMessage response = await client.PostAsJsonAsync("api/SendEMP", request).ConfigureAwait(false);
response.EnsureSuccessStatusCode();
return res;
}

I am getting the following response,.

"Result":
{
"resMsg": "OK"
},

"Id": 66,

"Exception": null,

"Status": 5,

"IsCanceled": false,

"IsCompleted": true,

"CreationOptions": 0,

"AsyncState": null,

"IsFaulted": false

but what i want is just

{
"resMsg": "OK"
}

can anyone please help me?

thanks

nick


Read Wsdl without Service reference or web reference in console application

$
0
0

Hi

i am having console application. i want to read the wsdl file without service reference or web reference.

This XML file does not appear to have any style information associated with it. The document tree is shown below.<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 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://locahost" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://locahost"><wsdl:types><s:schema elementFormDefault="qualified" targetNamespace="http://locahost"><s:element name="ParseUrl"><s:complexType/></s:element><s:element name="ParseUrlResponse"><s:complexType/></s:element><s:element name="GetMultiFields"><s:complexType><s:sequence><s:element minOccurs="0" maxOccurs="1" name="sUsername" type="s:string"/><s:element minOccurs="0" maxOccurs="1" name="sQueueName" type="s:string"/><s:element minOccurs="1" maxOccurs="1" name="IFullPageKey" type="s:int"/><s:element minOccurs="0" maxOccurs="1" name="sSession" type="s:string"/><s:element minOccurs="0" maxOccurs="1" name="sDataSource" type="s:string"/><s:element minOccurs="1" maxOccurs="1" name="IMode" type="s:int"/></s:sequence></s:complexType></s:element><s:element name="GetMultiFieldsResponse"><s:complexType><s:sequence><s:element minOccurs="0" maxOccurs="1" name="GetMultiFieldsResult"><s:complexType><s:sequence><s:element ref="s:schema"/><s:any/></s:sequence></s:complexType></s:element></s:sequence></s:complexType></s:element><s:element name="GetMultiFields_Project"><s:complexType><s:sequence><s:element minOccurs="0" maxOccurs="1" name="sUsername" type="s:string"/><s:element minOccurs="0" maxOccurs="1" name="sQueueName" type="s:string"/><s:element minOccurs="1" maxOccurs="1" name="IFullPageKey" type="s:int"/><s:element minOccurs="0" maxOccurs="1" name="sSession" type="s:string"/><s:element minOccurs="0" maxOccurs="1" name="sDataSource" type="s:string"/><s:element minOccurs="1" maxOccurs="1" name="IMode" type="s:int"/><s:element minOccurs="0" maxOccurs="1" name="ProjectName" type="s:string"/></s:sequence></s:complexType></s:element><s:element name="GetMultiFields_ProjectResponse"><s:complexType><s:sequence><s:element minOccurs="0" maxOccurs="1" name="GetMultiFields_ProjectResult"><s:complexType><s:sequence><s:element ref="s:schema"/><s:any/></s:sequence></s:complexType></s:element></s:sequence></s:complexType></s:element><s:element name="GetMultiFields_AES"><s:complexType><s:sequence><s:element minOccurs="0" maxOccurs="1" name="sUsername" type="s:string"/><s:element minOccurs="0" maxOccurs="1" name="sQueueName" type="s:string"/><s:element minOccurs="1" maxOccurs="1" name="IFullPageKey" type="s:int"/><s:element minOccurs="0" maxOccurs="1" name="sSession" type="s:string"/><s:element minOccurs="0" maxOccurs="1" name="sDataSource" type="s:string"/><s:element minOccurs="1" maxOccurs="1" name="IMode" type="s:int"/><s:element minOccurs="0" maxOccurs="1" name="oKey" type="s:base64Binary"/><s:element minOccurs="0" maxOccurs="1" name="oVector" type="s:base64Binary"/></s:sequence></s:complexType></s:element><s:element name="GetMultiFields_AESResponse"><s:complexType><s:sequence><s:element minOccurs="0" maxOccurs="1" name="GetMultiFields_AESResult" type="s:base64Binary"/></s:sequence></s:complexType></s:element><s:element name="GetLookupFields"><s:complexType><s:sequence><s:element minOccurs="0" maxOccurs="1" name="sUsername" type="s:string"/><s:element minOccurs="0" maxOccurs="1" name="sQueueName" type="s:string"/><s:element minOccurs="1" maxOccurs="1" name="IFullPageKey" type="s:int"/><s:element minOccurs="0" maxOccurs="1" name="sSession" type="s:string"/><s:element minOccurs="0" maxOccurs="1" name="sDataSource" type="s:string"/><s:element minOccurs="1" maxOccurs="1" name="IMode" type="s:int"/></s:sequence></s:complexType></s:element><s:element name="GetLookupFieldsResponse"><s:complexType><s:sequence><s:element minOccurs="0" maxOccurs="1" name="GetLookupFieldsResult"><s:complexType><s:sequence><s:element ref="s:schema"/><s:any/></s:sequence></s:complexType></s:element></s:sequence></s:complexType></s:element><s:element name="CompressedGetMultiFields"><s:complexType><s:sequence><s:element minOccurs="0" maxOccurs="1" name="sUsername" type="s:string"/><s:element minOccurs="0" maxOccurs="1" name="sQueueName" type="s:string"/><s:element minOccurs="1" maxOccurs="1" name="IFullPageKey" type="s:int"/><s:element minOccurs="0" maxOccurs="1" name="sSession" type="s:string"/><s:element minOccurs="0" maxOccurs="1" name="sDataSource" type="s:string"/><s:element minOccurs="1" maxOccurs="1" name="IMode" type="s:int"/></s:sequence></s:complexType></s:element><s:element name="CompressedGetMultiFieldsResponse"><s:complexType><s:sequence><s:element minOccurs="0" maxOccurs="1" name="CompressedGetMultiFieldsResult" type="s:base64Binary"/></s:sequence></s:complexType></s:element><s:element name="StoreLookupValues"><s:complexType><s:sequence><s:element minOccurs="0" maxOccurs="1" name="FieldGroupDoc"><s:complexType mixed="true"><s:sequence><s:any/></s:sequence></s:complexType></s:element><s:element minOccurs="0" maxOccurs="1" name="sDataSource" type="s:string"/><s:element minOccurs="0" maxOccurs="1" name="RouteName" type="s:string"/></s:sequence></s:complexType></s:element><s:element name="StoreLookupValuesResponse"><s:complexType><s:sequence><s:element minOccurs="0" maxOccurs="1" name="StoreLookupValuesResult"><s:complexType><s:sequence><s:element ref="s:schema"/><s:any/></s:sequence></s:complexType></s:element></s:sequence></s:complexType></s:element><s:element name="StoreFieldGroupValues"><s:complexType><s:sequence><s:element minOccurs="0" maxOccurs="1" name="FieldGroupDoc"><s:complexType mixed="true"><s:sequence><s:any/></s:sequence></s:complexType></s:element><s:element minOccurs="0" maxOccurs="1" name="QueueName" type="s:string"/><s:element minOccurs="1" maxOccurs="1" name="IMode" type="s:int"/><s:element minOccurs="0" maxOccurs="1" name="sDataSource" type="s:string"/></s:sequence></s:complexType></s:element><s:element name="StoreFieldGroupValuesResponse"><s:complexType><s:sequence><s:element minOccurs="0" maxOccurs="1" name="StoreFieldGroupValuesResult"><s:complexType><s:sequence><s:element ref="s:schema"/><s:any/></s:sequence></s:complexType></s:element></s:sequence></s:complexType></s:element><s:element name="CompressedStoreFieldGroupValues"><s:complexType><s:sequence><s:element minOccurs="0" maxOccurs="1" name="data" type="s:base64Binary"/><s:element minOccurs="0" maxOccurs="1" name="QueueName" type="s:string"/><s:element minOccurs="1" maxOccurs="1" name="IMode" type="s:int"/><s:element minOccurs="0" maxOccurs="1" name="sDataSource" type="s:string"/></s:sequence></s:complexType></s:element><s:element name="CompressedStoreFieldGroupValuesResponse"><s:complexType><s:sequence><s:element minOccurs="0" maxOccurs="1" name="CompressedStoreFieldGroupValuesResult" type="s:base64Binary"/></s:sequence></s:complexType></s:element><s:element name="StoreFieldGroupValuesToMQ"><s:complexType><s:sequence><s:element minOccurs="0" maxOccurs="1" name="FieldGroupDoc"><s:complexType mixed="true"><s:sequence><s:any/></s:sequence></s:complexType></s:element><s:element minOccurs="0" maxOccurs="1" name="QueueName" type="s:string"/><s:element minOccurs="1" maxOccurs="1" name="IMode" type="s:int"/><s:element minOccurs="0" maxOccurs="1" name="sDataSource" type="s:string"/></s:sequence></s:complexType></s:element><s:element name="StoreFieldGroupValuesToMQResponse"><s:complexType><s:sequence><s:element minOccurs="0" maxOccurs="1" name="StoreFieldGroupValuesToMQResult"><s:complexType><s:sequence><s:element ref="s:schema"/><s:any/></s:sequence></s:complexType></s:element></s:sequence></s:complexType></s:element><s:element name="StoreFieldGroupValuesToMQ_AES"><s:complexType><s:sequence><s:element minOccurs="0" maxOccurs="1" name="xml_encrypt" type="s:base64Binary"/><s:element minOccurs="0" maxOccurs="1" name="QueueName" type="s:string"/><s:element minOccurs="1" maxOccurs="1" name="IMode" type="s:int"/><s:element minOccurs="0" maxOccurs="1" name="sDataSource" type="s:string"/><s:element minOccurs="0" maxOccurs="1" name="oKey" type="s:base64Binary"/><s:element minOccurs="0" maxOccurs="1" name="oVector" type="s:base64Binary"/></s:sequence></s:complexType></s:element><s:element name="StoreFieldGroupValuesToMQ_AESResponse"><s:complexType><s:sequence><s:element minOccurs="0" maxOccurs="1" name="StoreFieldGroupValuesToMQ_AESResult"><s:complexType><s:sequence><s:element ref="s:schema"/><s:any/></s:sequence></s:complexType></s:element></s:sequence></s:complexType></s:element><s:element name="GetImage"><s:complexType><s:sequence><s:element minOccurs="0" maxOccurs="1" name="ImageFileName" type="s:string"/><s:element minOccurs="1" maxOccurs="1" name="ILeft" type="s:int"/><s:element minOccurs="1" maxOccurs="1" name="ITop" type="s:int"/><s:element minOccurs="1" maxOccurs="1" name="IRight" type="s:int"/><s:element minOccurs="1" maxOccurs="1" name="IBottom" type="s:int"/><s:element minOccurs="0" maxOccurs="1" name="DataSource" type="s:string"/><s:element minOccurs="1" maxOccurs="1" name="FullPage" type="s:boolean"/><s:element minOccurs="0" maxOccurs="1" name="PrimaryURL" type="s:string"/></s:sequence></s:complexType></s:element><s:element name="GetImageResponse"><s:complexType><s:sequence><s:element minOccurs="0" maxOccurs="1" name="GetImageResult" type="s:base64Binary"/></s:sequence></s:complexType></s:element><s:element name="GetImage_AES"><s:complexType><s:sequence><s:element minOccurs="0" maxOccurs="1" name="ImageFileName" type="s:string"/><s:element minOccurs="1" maxOccurs="1" name="ILeft" type="s:int"/><s:element minOccurs="1" maxOccurs="1" name="ITop" type="s:int"/><s:element minOccurs="1" maxOccurs="1" name="IRight" type="s:int"/><s:element minOccurs="1" maxOccurs="1" name="IBottom" type="s:int"/><s:element minOccurs="0" maxOccurs="1" name="DataSource" type="s:string"/><s:element minOccurs="1" maxOccurs="1" name="FullPage" type="s:boolean"/><s:element minOccurs="0" maxOccurs="1" name="PrimaryURL" type="s:string"/><s:element minOccurs="0" maxOccurs="1" name="oKey" type="s:base64Binary"/><s:element minOccurs="0" maxOccurs="1" name="oVector" type="s:base64Binary"/></s:sequence></s:complexType></s:element><s:element name="GetImage_AESResponse"><s:complexType><s:sequence><s:element minOccurs="0" maxOccurs="1" name="GetImage_AESResult" type="s:base64Binary"/></s:sequence></s:complexType></s:element><s:element name="GetWImage"><s:complexType><s:sequence><s:element minOccurs="0" maxOccurs="1" name="WorksetName" type="s:string"/><s:element minOccurs="0" maxOccurs="1" name="ImageFileName" type="s:string"/><s:element minOccurs="1" maxOccurs="1" name="ILeft" type="s:int"/><s:element minOccurs="1" maxOccurs="1" name="ITop" type="s:int"/><s:element minOccurs="1" maxOccurs="1" name="IRight" type="s:int"/><s:element minOccurs="1" maxOccurs="1" name="IBottom" type="s:int"/><s:element minOccurs="0" maxOccurs="1" name="DataSource" type="s:string"/><s:element minOccurs="1" maxOccurs="1" name="FullPage" type="s:boolean"/><s:element minOccurs="0" maxOccurs="1" name="PrimaryURL" type="s:string"/></s:sequence></s:complexType></s:element><s:element name="GetWImageResponse"><s:complexType><s:sequence><s:element minOccurs="0" maxOccurs="1" name="GetWImageResult" type="s:base64Binary"/></s:sequence></s:complexType></s:element><s:element name="GetWImage_AES"><s:complexType><s:sequence><s:element minOccurs="0" maxOccurs="1" name="WorksetName" type="s:string"/><s:element minOccurs="0" maxOccurs="1" name="ImageFileName" type="s:string"/><s:element minOccurs="1" maxOccurs="1" name="ILeft" type="s:int"/><s:element minOccurs="1" maxOccurs="1" name="ITop" type="s:int"/><s:element minOccurs="1" maxOccurs="1" name="IRight" type="s:int"/><s:element minOccurs="1" maxOccurs="1" name="IBottom" type="s:int"/><s:element minOccurs="0" maxOccurs="1" name="DataSource" type="s:string"/><s:element minOccurs="1" maxOccurs="1" name="FullPage" type="s:boolean"/><s:element minOccurs="0" maxOccurs="1" name="PrimaryURL" type="s:string"/><s:element minOccurs="0" maxOccurs="1" name="oKey" type="s:base64Binary"/><s:element minOccurs="0" maxOccurs="1" name="oVector" type="s:base64Binary"/></s:sequence></s:complexType></s:element><s:element name="GetWImage_AESResponse"><s:complexType><s:sequence><s:element minOccurs="0" maxOccurs="1" name="GetWImage_AESResult" type="s:base64Binary"/></s:sequence></s:complexType></s:element><s:element name="GetArchiveImage"><s:complexType><s:sequence><s:element minOccurs="1" maxOccurs="1" name="ImgDets" type="tns:ImageDetails"/><s:element minOccurs="1" maxOccurs="1" name="FullPage" type="s:boolean"/><s:element minOccurs="0" maxOccurs="1" name="PrimaryURL" type="s:string"/></s:sequence></s:complexType></s:element><s:complexType name="ImageDetails"><s:sequence><s:element minOccurs="0" maxOccurs="1" name="ImageFileName" type="s:string"/><s:element minOccurs="0" maxOccurs="1" name="ProjectName" type="s:string"/><s:element minOccurs="0" maxOccurs="1" name="CustomerName" type="s:string"/><s:element minOccurs="0" maxOccurs="1" name="JulianDate" type="s:string"/><s:element minOccurs="0" maxOccurs="1" name="BaseDir" type="s:string"/><s:element minOccurs="1" maxOccurs="1" name="ILeft" type="s:int"/><s:element minOccurs="1" maxOccurs="1" name="ITop" type="s:int"/><s:element minOccurs="1" maxOccurs="1" name="IRight" type="s:int"/><s:element minOccurs="1" maxOccurs="1" name="IBottom" type="s:int"/></s:sequence></s:complexType><s:element name="GetArchiveImageResponse"><s:complexType><s:sequence><s:element minOccurs="0" maxOccurs="1" name="GetArchiveImageResult" type="s:base64Binary"/></s:sequence></s:complexType></s:element><s:element name="GetSnippets"><s:complexType><s:sequence><s:element minOccurs="0" maxOccurs="1" name="ProjectName" type="s:string"/><s:element minOccurs="0" maxOccurs="1" name="FieldGroups" type="tns:ArrayOfFieldGroup"/><s:element minOccurs="1" maxOccurs="1" name="FullPage" type="s:boolean"/><s:element minOccurs="0" maxOccurs="1" name="sDataSource" type="s:string"/><s:element minOccurs="0" maxOccurs="1" name="PrimaryURL" type="s:string"/></s:sequence></s:complexType></s:element><s:complexType name="ArrayOfFieldGroup"><s:sequence><s:element minOccurs="0" maxOccurs="unbounded" name="FieldGroup" nillable="true" type="tns:FieldGroup"/></s:sequence></s:complexType><s:complexType name="FieldGroup"><s:sequence><s:element minOccurs="0" maxOccurs="1" name="BatchstartDate" type="s:string"/><s:element minOccurs="1" maxOccurs="1" name="ClarifyFlag" type="s:boolean"/><s:element minOccurs="1" maxOccurs="1" name="CrashState" type="s:boolean"/><s:element minOccurs="0" maxOccurs="1" name="CustomerName" type="s:string"/><s:element minOccurs="0" maxOccurs="1" name="DCN" type="s:string"/><s:element minOccurs="0" maxOccurs="1" name="DynamicCoords" type="tns:ArrayOfDynamicCoordinateImage"/><s:element minOccurs="0" maxOccurs="1" name="DynamicCoodinateDispZones" type="tns:ArrayOfDynamicCoodinateDispZones"/><s:element minOccurs="1" maxOccurs="1" name="EndTime" type="s:dateTime"/><s:element minOccurs="0" maxOccurs="1" name="ErrorMessage" type="s:string"/><s:element minOccurs="0" maxOccurs="1" name="FieldDetails" type="tns:ArrayOfField"/><s:element minOccurs="0" maxOccurs="1" name="GroupDesc" type="s:string"/><s:element minOccurs="0" maxOccurs="1" name="GroupID" type="s:string"/><s:element minOccurs="1" maxOccurs="1" name="GroupType" type="tns:GType"/><s:element minOccurs="1" maxOccurs="1" name="IsDHavailable" type="s:boolean"/><s:element minOccurs="1" maxOccurs="1" name="IColumns" type="s:int"/><s:element minOccurs="1" maxOccurs="1" name="ICurrentRowCount" type="s:int"/><s:element minOccurs="1" maxOccurs="1" name="IFetchCount" type="s:int"/><s:element minOccurs="1" maxOccurs="1" name="IGHeight" type="s:int"/><s:element minOccurs="1" maxOccurs="1" name="IGLeft" type="s:int"/><s:element minOccurs="1" maxOccurs="1" name="IGTop" type="s:int"/><s:element minOccurs="1" maxOccurs="1" name="IGWidth" type="s:int"/><s:element minOccurs="1" maxOccurs="1" name="IKeyedFields" type="s:int"/><s:element minOccurs="1" maxOccurs="1" name="ILasteventid" type="s:int"/><s:element minOccurs="1" maxOccurs="1" name="ILinkedGroupIndex" type="s:int"/><s:element minOccurs="1" maxOccurs="1" name="ImageError" type="s:boolean"/><s:element minOccurs="0" maxOccurs="1" name="ImageFileName" type="s:string"/><s:element minOccurs="1" maxOccurs="1" name="IRowCount" type="s:int"/><s:element minOccurs="1" maxOccurs="1" name="ISeconds" type="s:double"/><s:element minOccurs="1" maxOccurs="1" name="ISnippetHeight" type="s:int"/><s:element minOccurs="1" maxOccurs="1" name="ISnippetWidth" type="s:int"/><s:element minOccurs="1" maxOccurs="1" name="IsPushToImageCorrection" type="s:boolean"/><s:element minOccurs="1" maxOccurs="1" name="PageGroupId" type="s:long"/><s:element minOccurs="1" maxOccurs="1" name="PageId" type="s:long"/><s:element minOccurs="0" maxOccurs="1" name="PageType" type="s:string"/><s:element minOccurs="1" maxOccurs="1" name="Priority" type="s:int"/><s:element minOccurs="1" maxOccurs="1" name="ProjectId" type="s:int"/><s:element minOccurs="0" maxOccurs="1" name="ProjectName" type="s:string"/><s:element minOccurs="1" maxOccurs="1" name="StartTime" type="s:dateTime"/><s:element minOccurs="1" maxOccurs="1" name="Statuscodeid" type="s:int"/><s:element minOccurs="1" maxOccurs="1" name="Worksetid" type="s:long"/><s:element minOccurs="0" maxOccurs="1" name="WorksetName" type="s:string"/><s:element minOccurs="1" maxOccurs="1" name="FITTOWIDTH" type="s:boolean"/><s:element minOccurs="0" maxOccurs="1" name="ClariUser" type="s:string"/><s:element minOccurs="0" maxOccurs="1" name="LinkedSnippets" type="tns:ArrayOfBase64Binary"/><s:element minOccurs="0" maxOccurs="1" name="ClariNote" type="s:string"/><s:element minOccurs="1" maxOccurs="1" name="PageCount" type="s:int"/><s:element minOccurs="1" maxOccurs="1" name="PrimarySubGroupTypeFieldCount" type="s:int"/><s:element minOccurs="0" maxOccurs="1" name="LookupLog"><s:complexType mixed="true"><s:sequence><s:any/></s:sequence></s:complexType></s:element><s:element minOccurs="0" maxOccurs="1" name="AppRequestId" type="s:string"/><s:element minOccurs="0" maxOccurs="1" name="AppStoreRequestId" type="s:string"/><s:element minOccurs="0" maxOccurs="1" name="WebRequestId" type="s:string"/><s:element minOccurs="1" maxOccurs="1" name="StoreBufferAddedOn" type="s:dateTime"/><s:element minOccurs="1" maxOccurs="1" name="StoreBufferSentOn" type="s:dateTime"/><s:element minOccurs="1" maxOccurs="1" name="GetBufferAddedOn" type="s:dateTime"/><s:element minOccurs="1" maxOccurs="1" name="GetBufferSentOn" type="s:dateTime"/><s:element minOccurs="0" maxOccurs="1" name="Note" type="s:string"/><s:element minOccurs="0" maxOccurs="1" name="MultiZones" type="tns:ArrayOfMultiZone"/><s:element minOccurs="1" maxOccurs="1" name="MultiZoneAlignment" type="tns:MultiZoneAlignment"/><s:element minOccurs="1" maxOccurs="1" name="IsPushToMFID" type="s:boolean"/><s:element minOccurs="1" maxOccurs="1" name="FITTOWINDOW" type="s:boolean"/><s:element minOccurs="0" maxOccurs="1" name="DynamicBRvalidation" type="s:string"/><s:element minOccurs="1" maxOccurs="1" name="ENABLEAUTOSCROLL" type="s:boolean"/><s:element minOccurs="1" maxOccurs="1" name="DYNAMICROWCOUNT_UPLOAD" type="s:int"/><s:element minOccurs="1" maxOccurs="1" name="DYNAMICROWCOUNT_KEY" type="s:int"/><s:element minOccurs="1" maxOccurs="1" name="SnippetType" type="tns:SnippetAllignment"/><s:element minOccurs="1" maxOccurs="1" name="NAVIGATECOLUMNWISE" type="s:boolean"/><s:element minOccurs="1" maxOccurs="1" name="ORIENTATION" type="tns:GRIDORIENTATION"/><s:element minOccurs="0" maxOccurs="1" name="CustomColumnCount" type="s:string"/><s:element minOccurs="0" maxOccurs="1" name="IMAGECOORDSLEFT" type="s:string"/><s:element minOccurs="0" maxOccurs="1" name="IMAGECOORDSTOP" type="s:string"/><s:element minOccurs="0" maxOccurs="1" name="IMAGECOORDSWIDTH" type="s:string"/><s:element minOccurs="0" maxOccurs="1" name="IMAGECOORDSHEIGHT" type="s:string"/><s:element minOccurs="1" maxOccurs="1" name="DynamicSLineDelFlag" type="s:boolean"/><s:element minOccurs="0" maxOccurs="1" name="DynamicSLineDelLineseq" type="s:string"/><s:element minOccurs="1" maxOccurs="1" name="MaxDelseq" type="s:int"/><s:element minOccurs="0" maxOccurs="1" name="DynamicRowZone" type="tns:ArrayOfDynamicRowZone"/><s:element minOccurs="1" maxOccurs="1" name="STATICHEADER" type="s:boolean"/><s:element minOccurs="1" maxOccurs="1" name="SHOWALLZONES" type="s:boolean"/><s:element minOccurs="0" maxOccurs="1" name="SHLEFT" type="s:string"/><s:element minOccurs="0" maxOccurs="1" name="SHTOP" type="s:string"/><s:element minOccurs="0" maxOccurs="1" name="SHWIDTH" type="s:string"/><s:element minOccurs="0" maxOccurs="1" name="SHHEIGHT" type="s:string"/><s:element minOccurs="0" maxOccurs="1" name="SKIP_VALIDATOR" type="s:string"/>

How to convert Curl request to Httpclient C#

$
0
0

Below curl request working fine but when i convert this request in c# web request then i got error.

curl request working fine:

curl --key private.pem --cert public.crt --data "{\"branch_reference\":\"123\"}" 
--header "Content-type: application/json; profile=https://realtime-listings.webservices.zpg.co.uk/docs/v1.2/schemas/listing/list.json"
https://realtime-listings-api.webservices.zpg.co.uk/sandbox/v1/listing/list

C# web request has error

        ServicePointManager.Expect100Continue = true;
        ServicePointManager.DefaultConnectionLimit = 9999;
        ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3| SecurityProtocolType.Tls12; 

        string certificateText = File.ReadAllText(@"D:\public.crt");
        string privateKeyText = File.ReadAllText(@"D:\private.pem");
        ICertificateProvider provider = new CertificateFromFileProvider(certificateText, privateKeyText);
        X509Certificate2 clientCertificate = provider.Certificate;

        var httpWebRequest = (HttpWebRequest)WebRequest.Create("https://realtime-listings-api.webservices.zpg.co.uk/sandbox/v1/listing/list");
        httpWebRequest.ContentType = "application/json; profile=https://realtime-listings.webservices.zpg.co.uk/docs/v1.2/schemas/listing/list.json";
        httpWebRequest.Method = "POST";
        httpWebRequest.ClientCertificates.Add(clientCertificate);

        ServicePointManager.ServerCertificateValidationCallback +=new RemoteCertificateValidationCallback((sender, certificate, chain, policyErrors) =>{return true;});

        using (var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream()))
        {
            string json = "{\"branch_reference\":\"123\"}";
            streamWriter.Write(json);
            streamWriter.Flush();
        }

        var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
        using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
        {
            var result = streamReader.ReadToEnd();
        }

Error Detail:

The request was aborted: Could not create SSL/TLS secure channel.

error in below line

var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();

Any one can help on this?

</div> </div>

Emitdefault = false doesn't work

$
0
0

Hi

I have the code.

[DataContract]
public class Employee
{
    [DataMember(EmitDefaultValue = false)]
    public string position {get; aet;}
	[DataMember(EmitDefaultValue = false)]
    public int salary {get; aet;}
	[DataMember(EmitDefaultValue = false)]
    public int? bonus {get; set;} = null

    [DataMember(EmitDefaultValue = false)]
    public int targetSalary {get; aet;}
}

I can see the null value in the result of bonus 

I read this articule, tried to replicate it and it doesn't work: 

https://docs.microsoft.com/en-us/dotnet/api/system.runtime.serialization.datamemberattribute.emitdefaultvalue?redirectedfrom=MSDN&view=netframework-4.7.2#System_Runtime_Serialization_DataMemberAttribute_EmitDefaultValue

WCF - returning an strongly typed array/list with basicHttpBinding

$
0
0

Hello Folks,

In process of building/modifying WCF service and client.

There are TWO requirements:

  • must be used binding=basicHttpBinding
  • must be used customer types

So, I do wrote a code for a class returned by the service:

[DataContract]
public class TPartialReport
{
  [DataMember]
  public List<TFile> Files1 { get; set; }

  [DataMember]
  public TFileList Files2 { get; set; }
}

A TFileList are a simple coverage for second requirement

[DataContract]
public class TFileList 
  : List<TFile>
{
}

TFile: 

[DataContract]
public class TFile
{
  [DataMember]
  public string RelativeFilename { get; set; }
}

Problem is:

  • if I use List<TFile> - I do violate second requirement,
  • if I use TFileList - I can't satisfy first requirement as content type changed from application/xml to application/soap+xml and this require different binding type.

Question is : is there a possibility to satisfy BOTH requirements? 

If - Yes - how to define TFileList?

How to call windows exe file in ASP.NET Application which has been hosted in IIS

$
0
0

Hi,

How to call windows exe file in ASP.NET Application which has been hosted in IIS.?

The exe does, fetching records from SAP and keep it in local folder.

I have been facing the below issues.

1) I am not able to call the exe file in ASP.NET file.
2) I am not able to connect SAP through ASP.NET which is hosted in IIS.

Can any one give idea/suggestion, how to proceed above scenario...?

Viewing all 555 articles
Browse latest View live


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