How can I use async/await to call a webservice?

Assuming that loginAsync returns void, and loginCmpleted event fires when login is done, this is called the Event-based Asynchronous Pattern, or EAP. To convert EAP to await/async, consult Tasks and the Event-based Asynchronous Pattern. In particular, you’ll want to make use of the TaskCompletionSource to convert the event-based model to a Task-based model. Once you’ve … Read more

Importing xsd into wsdl

You have a couple of problems here. First, the XSD has an issue where an element is both named or referenced; in your case should be referenced. Change: <xsd:element name=”stock” ref=”Stock” minOccurs=”1″ maxOccurs=”unbounded”/> To: <xsd:element name=”stock” type=”Stock” minOccurs=”1″ maxOccurs=”unbounded”/> And: Remove the declaration of the global element Stock Create a complex type declaration for a … Read more

How to get service reference to generate correctly with message contracts based on 3rd party WSDL, or force no message contracts in WF Service project

I am far from an authority on these issues, and while this response below might not be an exact fit to your problem, my recent experience of making a proxyless connection to a service might offer some insight to you or the next person with a similar issue. I would start by seeing if you … Read more

Can I disable SOP (Same Origin Policy) on any browser for development?

UPDATE 6/2012: This used to work at the time of the writing, but obviously no more. Sorry. In Firefox (might apply to other Gecko-based browsers as well) you can use the following JavaScript snippet to allow cross-domain calls: if (navigator.userAgent.indexOf(“Firefox”) != -1) { try { netscape.security.PrivilegeManager.enablePrivilege(“UniversalBrowserRead”); } catch (e) { alert(“Permission UniversalBrowserRead denied — not … Read more

Visual Studio does not generate app.config content when “add service reference”

When adding the service reference try clicking on the ‘Advanced…’ button and then uncheck the ‘Reuse types in referenced assemblies’ checkbox. I found this out when I had created a simple project to test a third party service which all worked fine. Attempting to add the same reference to the main project resulted in the … Read more

How to use a class customization to resolve file generating conflicts

The error message you are facing basically states that some names in the the typessection of your wsdl are used two times. In your case all <element>tags have the same name as their corresponding types (defined as <complexType>). Example: <s:element name=”SearchFlights”> <s:complexType> <s:sequence> <s:element minOccurs=”0″ maxOccurs=”1″ name=”SoapMessage” type=”tns:SearchFlights” /> </s:sequence> </s:complexType> </s:element> <s:complexType name=”SearchFlights”> <s:complexContent … Read more

tech