Web Service Connection Fails After It is Ported To WCF - web-services

I am the developer of an application which is the consumer of an in-house developed web service. The web service was originally developed in Java and deployed in JBoss.
Recently, I have been notified that the web service had been completely ported to .NET WCF. I simply updated the web service endpoint URI string in my configuration file, but my application has failed to connect to the new web service.
Upon comparing the old and new WSDLs, I can see that the methods and the structures are the same, but somehow the namespaces and the internal structures of arrays are different.
What do you suggest so that my application would be compatible with the new web service?
Thank you very much.

Namespace change means the WSDL of both Java Web service and WCF service are different. You know in programming classes of the same name but in different namespaces are totally different classes. Likewise, though the method signatures and data signatures look the same, however, in different XML namespace of WSDL, they are different contracts. Thus on your client side, you should have new set of proxy classes to talk the the WCF service.
You may ask the developers of the Web services about what were the intend of changing Xml namespace in WSDL. If for the co-existence of both Java Web service and Wcf Web service and enforcing some changes on client side, you MUST generated new proxy classes against the new WSDL, and it is recommended to use svcutil.exe rather than Service Reference in IDE so you have fine gained control over CLR namespace mapping to Xml namespace.
If the service developer could reverse the change the Xml namespace of WSDL for good reasons and the WSDL could remain the same, you just need to change only URL.

Related

Understanding SOAP vs REST from an authentication point of view

So I have currently been assigned to read about Web Services. I was going through the differences between REST, XML-RPC and SOAP and came across this particular link :
REST vs XML-RPC vs SOAP
It mentions this following, in terms of authentication and authorization
As for authentication and authorization, SOAP places the burden in the hands of the application developer. The REST methodology instead takes into account the fact that Web servers already have support for these tasks. Through the use of industry-standard certificates and a common identity management system, such as an LDAP server, developers can make the network layer do all the heavy lifting.
I was not able to understand this particular reference. Can some one explain how this happens in detail?
A web service is method or mechanism to communicate between different applications using open standard such as XML, WSDL, and SOAP. Using web service different device or program communicates over network
Type of WebService
SOAP Web Service
RESTFul Web Service
more information you can check :http://entityclass.in/rest/home.htm

Web Services - What exactly are they?

What does a Web service really mean ? I am not looking for a theoretical explanation, I am looking for something practical.
I was thinking that anything I can call from an external client is a Web service, so a basic PHP which returns JSON data could be a Web service.
But then I started reading about Web services in W3Schools.org and I got confused. If the PHP URL which returns JSON data is a web service, why would I need to do SOAP, WDSL etc ... to create a Web service. Isn't it extra work?
Also, if SOAP is the way data is sent back and forth, what about other transport types?
What differentiates a RESTful Web service from a SOAP based web service?
When you are talking about a webservice people generally misunderstand what it means, a webservice is simply a way to interact between a and b that abstracts the use of local technology standards. A WSDL defines the way in which the SOAP message is being sent over the channel. REST uses JSON over HTTP, WSDL uses SOAP over HTTP.
The advantage of a webservice is, say you develop one piece of code in .net and you wish to use JAVA to consume this code. You can interact directly with the abstracted layer and are unaware of what technology was used to develop the code.
SOA is a set of design paradigms and standards that tell you how to develop your services, in SOA each service is meant to comply with the principles listed below. WSDL is generally linked with but not essential for a SOA solution. If you wish to learn about SOA google "Thomas Erl SOA".
Priciples of SOA
Standardized service contract
Service loose coupling
Service abstraction
Service reusability
Service autonomy
Service statelessness
Service discoverability
Service composability
This Q&A Restful vs Other Web Services brings a lot of light to what is a webserver, and differences from SOAP and REST. Id recommend to read all the answers (many of them are very good).

Approaches for creating REST Web services?

i am new to REST Service development. I compared the development mechanism for both REST and WS web services and i found that you can create a WS web service using WSDL file that is the top down appraoch (Correct me if i am wrong) and using bottom up approach also, that is generating the classes manually.
But when it comes to REST web service development you have to follow bottom up approach only that is generating the classes manually. NetBeans IDE provides certain wizards for creating REST web service quickly from databases, entity classes and patterns.
I had also seen when you are developing web service in eclipse and you are using wizard in eclipse IDE, you can create a REST web service from WSDL file. I found this very strange. My question here is what are the approaches we can have for creating REST web services. Can we create REST web services using top-down and bottom up approached. If yes then please provide me details.
Thanks.
It is possible to describe a REST service using a contract. This is the intent of WADL and WSDL 2.0. WADL is specifically a REST contract, whereas WSDL 2.0 evolved from the original WSDL spec. to support all HTTP bindings. Since REST services rely on the use of HTTP methods and headers to exchange messages a WSDL 2.0 contract can work. There is a really good explanation here: http://ajaxonomy.com/2008/xml/web-services-part-2-wsdl-and-wadl
For development of REST services, I'm not sure if NetBeans, Eclipse or other tools specifically support automated REST service from WSDL generation. I would imagine that most are still intended for SOAP service creation. At this point I think WSDL 2.0 and WADL can be used to describe a REST service, but are not intended for automated generation of a REST service.
REST services are simple HTTP request/response,and therefore don't require complex stubs. In most cases it would probably take more time to write the WSDL describing the REST service, than it would take to write the REST service itself.

How to expose locally installed application as Web Service?

Suppose I have 2 web services A and B in SOA project. Both web services are running on a remote servers. Web Service A depends on information available from only a locally installed desktop application on a human actor machine and thats all web service A does i.e. provide this information). There are hundreds of such human actors with the same locally installed application providing its own information that web service A needs. Web service B needs this information from web service A, the result of which (which is the whole benefit of this project) is provided to that human actor who originated this process (by loging into system and clicking some command button). So this human actor is acting like the consumer of Web service B. The question is how can I make this locally installed application act as Web Service A (in the context of SOA project)?
This question could best be answered by some one with extensive experience in Web services and SOA.
This SOA project uses java, like ESB based on Java and there is no Microsoft specific services running although the desktop application is a Windows application. The application provides c/C++ API for an external process to call and retrieve the information needed by Web service A. What I want is the both web services A and B are hosted on remote server and interacting with each other via ESB but the problem is how to make local application information available to Web Service A?
There are two types of solutions
The first: have the original client application add a parameter with the address of web service A, and use this address for calling the service.
The second: pass a more abstract user identifier from the client (actually, there's a good chance you have such a field in the service). and use a translation service to retrieve the physical address corresponding to this id.
To allow such translation, the desktop application that acts as a server needs to "register" with the translation service when starting up.
If you are using an ESB, or other SOA infrastructure (like a service directory, message queuing service) it will include much of the functionality you need to build the translation service.
regarding the actual hosting of the service in the client machine.
the simplest solution is to use a different process from the actual application, and just access the files or DB the application uses.
In this case you can use any infrastructure you like to develop the service.
a more complex scenario is when you need the actual application to supply the service. in this case you will need to have a thread in the application that listens to service requests.
if you are using WCF see Hosting Services about how to host a web service in your application.
EDIT
some additions regarding you clarification.
as I understand, the desktop application exposes a C\C++ API that is available for external processes on the same machine.
You can either write a web service that will use this API. Googling "C++ Web Services Windows" will give yo several relevant pointers on implementing those.
Another good option is to use a messaging infrastructure. most JMS providers provide API's in languages other then Java - including C++.
Your application will be a C++ windows service that listens and sends messages to you JMS provider.

Designing a web service to be called by another language

This will sound naive (but then I am a junior programmer), but if I write a web service say in Python (standard WSDL web service), I then need to host it so it is reachable from an end point.
This will give a URI for the service and then from another language, say Java or VB.NET (any), I can add a web service (this one) and then call the web service's object model, correct?
Thanks
if I write a web service say in Python (standard WSDL web service), I then need to host it so it is reachable from an end point.
By definition, a web service need to be exposed through HTTP i.e. "hosted" (by the way, WSDL is a language to describe a web service).
then from another language, say Java or VB.NET (any), I can add a web service (this one) and then call the web service's object model, correct?
Without entering in the details, web services are basically web APIs accessed via HTTP. So yes, you will be able to call a web service from any language than can make HTTP requests (not sure what you mean by "add a web service" though).
If you are expecting a more precise answer, feel free to ask a more precise question :)