Create similar WSDL file to existing WSDL file - c#

I have a WSDL file for a Web service created in java
I need to create an identical WSDL file in C#(asmx or WCF doesn't matter) .NET where the only existing web method implementation would be changed but keep the same signature though.
I always have different WSDL files which won't work for the client
EDIT
I ended up using WSCF(web service contract first) it seems the only solution out there
the resulting WSDL with some manual minor modifications seems quite similar to the original file.

Your approach is a little off. I interpret your question as
How to use a WSDL file to create a WCF service?

Related

Generate c# service skeleton from service reference

I created a service reference with VS to a soap service. Now the server is offline and I would like to build a simple server for testing purposes. I've already tried wsdl.exe with the wsdl file but didn't work because it couldn't reach the server.
Is there any simple way to acheive this? Of course, I'm not expecting any business logic to be magically created, just the structures and empty methods. Then I'll make it respond with dummy data.
In the folder [project]\ServiceReferences\[service reference name] you'll find two files: one .wsdl and other .xsd
The xsd file contains the information that wsdl.exe was trying to get online. So running:
wsdl /language:CS /serverInterface file.wsdl file.xsd
will create the interface for the service. Then, create a new Wsdl Service Library project, add the interface (the new .cs file found in the same folder than wsdl.exe) and add the correct attributes to the interface, methods and data objects (if there's any).
Creating the service class is easy now that you have the interface.

Forbidden XML Schema constructs in WSDL of a web service

I am a Java developer who has created a rather big Web service that works nice with Java clients or other tools (Soap UI).
One of our clients wants to write a .NET client for the web service and uses the "add service reference" feature of VS2010. According to the client this does not work since our WSDL and XSD files use "Forbidden XML constructs" as defined in this article:
The problem is that we have made heavy usage of xsd:attribute data in WSDL.
So the question is:
Is there a workaround to make .NET stub generation code compliant with WSDL/XSD files that contain xsd:attribute? Is there another .NET library for webservices that supports this feature?
Another question of mine would be why does Microsoft impose these limitations in the first place? Why xsd:attribute is a forbidden costruct in a web service??? Any clues on that?
Probably related: C#.NET Generating web service reference using WSDL (from XML schema) problem
If you have access to a machine with the .NET Framework on it why don't you use svcutil to generate a proxy/config settings for him and send it to him?
See www.svcutil.com for the list of switches and options that are available to you
I have found that if the customer cannot do it one way and you provide a documented (possibly automated) way of doing things then that will generally suffice.
I have tested the HelloWorld.wsdl supplied in the link with the .NET version of Remobjects (http://www.remobjects.com) and it seemed to work fine. I don't have an actual service to test this with but I would suggest that you (or the client :) ) download it and give it a try.
The .NET version can be found here:
http://www.remobjects.com/ro/net.aspx
Apparently the answer is that you should NOT use the modern way of generating stubs with svcutil.exe and instead use the legacy way with wsdl.exe
Creating stubs from the command line with wsdl.exe works fine. The resulting code works as expected and the .NET client connects to the Axis2 Web service.

I am making ASP.Net MVC2 Web Service not WCF. How do I easily create WSDL for it?

If I use WCF getting a WSDL response or file is a piece of cake.
I'm not.., I am using MVC2 to create my web service that will serialize eventually XML and Json.
Schema definition aside.., I want to easily have my ASP.Net MVC2 Web Service have a service definition defining the methods, types, parameters, and etc. Hopefully you get the picture.
Am I missing something in VS 2010 that does this, a codeplex project, or whatever.
Is it that I have to build a WSDL pro-grammatically from scratch?
Please help.
If you want a WSDL then use WCF as it already has this functionality built-in and don't reinvent wheels. If you go the ASP.NET MVC way of generating JSON and XML you are pretty much on your own. And don't forget that WSDL is a SOAP artifact and not JSON or XML.
If you decide to go the REST route, make sure you follow the well established conventions
and write a good documentation for your service consumers.

Developing .NET Web Service from WSDL file

What's the best practices for developing a web service with a WSDL as a start point?
Use SvcUtil to generate your service interface and then develop a service against that. Here is an example.
Your question is a little vaque, but developing web services with .net is quite easy.
Using visual studio, most of the things are generated for you. You can add methods as
[WebMethod]
public string hello(){
return "hello"
}
and luckily once you deploy it, the wsdl is generated for you.
If you are looking to download some entities from a wsdl, you can use the wsdl utility and invoke a wsdl to download the entity class.
Check out the WCF Developer Center on MSDN - it has tons of tutorials, article, screencasts that show you how to create a SOAP based web service, based on code or WSDL.
I found this question helpful when I had the same question in the past.
Create an ASMX web service from a WSDL file
The problem I had was that I was given a WSDL. I needed to create web service methods based on the contract that the WSDL provided.

Using WSDL for sending and receiving in C#

You are given a WSDL and a sample soap message, is there a good tutorial or sample code in using that WSDL to consume a web service? Does the WSDL follow a certain format in order for which it can be consumed properly? I recall a web service in Java that I changed certain tags and attributes in order for this to work, is there a general convention for the formatting used in WSDLs?
I think this might be harder than #1. You are given a WSDL and a sample soap message. Is there a way to use that given WSDL and not the WSDL generated by C# web service when exposing a web service? Is there a way to somehow "override" the WSDL of the web service to the given web service? Are there any conflicts in formatting and compatibility of the WSDL that ought to be considered?
The quickest and most painless approach is simply to use svcutil to generate the code representing the WSDL. At that point the code produced can be used as a client to query an existing service or you can define a class implemeting the service contact. Once you have the .NET classes the SOAP message example will just serve as documentation.
the default usage would be want you most likely want
svcutil myRemoteService.wsdl
which will generate a a file named [servicename].CS file and an output.config containing the necessary WCF client bindings.
Not sure what you mean by overriding the WSDL as it is the published contract that the service honors. So if you want to change method signatures or behavior it will no longer work as the change will no longer conform to the WSDL.

Categories

Resources