Note that there are some explanatory texts on larger screens.

plurals
  1. POTrying to invoke a webservice(wsdl) using c# in Visual Studio 2010
    primarykey
    data
    text
    <p>I am not a .Net Programmer and I am pretty new to it,I have created an Webservice using Java(Apache CXF Framework) and trying to invoke the same using a .Net client,for that I am using the below c# code,And I have added the webrefrence and trying to import the reference,I am getting an error like,</p> <blockquote> <p>the type or namespace cannot be found are you missing a using directive or an assembly reference</p> </blockquote> <p>I have seen in stack overflow that to change the build properties Target Framework to .Net Framework 4 from 4.5 client profile,and changed so,but still I am getting the same error.I am using HTTPS connection.I have given below the code,I am beginner in C#.</p> <pre><code>using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Net; namespace SampleAccountClient { class Program { static void Main(string[] args) { try { ServicePointManager.ServerCertificateValidationCallback = delegate { return true; }; Information service = new Information(); service.customer= "CC_XX"; service.region = "XX"; service.lang = "XX"; service.service = "AccountInquiry"; service.version = "1"; service.sessionId = "427a8bff9d084752bb49ad5bd5c65337"; Account investment = new Account(); investment.Information = service; investment.No = "123456"; investment.Loss = LOSS.TRUE; //AccountInquiryPortTypeClient client = new AccountInquiryPortTypeClient(); AccountInquiryPortTypeClient client = new AccountInquiryPortTypeClient("AccountInquiryHttpPort", "**https**://xxx-xx-xx-XXX.xxxx.XX/xx/services/xxxxxx"); SampleAccountInquiryPortType portType = (SampleAccountInquiryPortType)client.InnerChannel; // client.ClientCredentials.ClientCertificate. // SampleAccountDetail invesDetail = client.getAccount(investment); AccountDetail invesDetail = portType.getAccount(investment); Console.WriteLine("" + invesDetail.Information.client); Console.ReadLine(); } catch (SystemException FaultException) { Console.WriteLine(FaultException.Message); Console.ReadLine(); } } } } </code></pre> <p>And my app/config file looks like:</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;configuration&gt; &lt;configSections&gt; &lt;sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"&gt; &lt;section name="AccountClient.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/&gt; &lt;/sectionGroup&gt; &lt;/configSections&gt; &lt;system.serviceModel&gt; &lt;bindings/&gt; &lt;client/&gt; &lt;/system.serviceModel&gt; &lt;applicationSettings&gt; &lt;AccountClient.Properties.Settings&gt; &lt;setting name="AccountClient_Ref_SampleInquiry" serializeAs="String"&gt; &lt;value&gt;https://xxx-xx-xxx-xxx.xxx.xxx/xxx/services/SampleAccountInquiry&lt;/value&gt; &lt;/setting&gt; &lt;/SampleAccountClient.Properties.Settings&gt; &lt;/applicationSettings&gt; &lt;startup&gt;&lt;supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/&gt;&lt;/startup&gt;&lt;/configuration&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload