how to configure WCF in BizTalk 2010 - biztalk

I want to send data to web service and receive data response from the same web service
Anyone have a tutorial for configuring binding in BizTalk administration?

The easy way is to use the BizTalk WCF Service Consuming Wizard to generate schema and binding information for the port (that you asked for). This is done from a locally saved wsdl or directly if there is a MEX point exposed.
A guide can be found at:
http://msdn.microsoft.com/en-us/library/bb226552.aspx
For detailed information about the WCF adapters in 2010 can be found at:
http://msdn.microsoft.com/en-us/library/bb259952.aspx

Related

Invoke web service on creating a web service proxy on data power

We have a SOA Service Registry with in our organization. This is a custom build web application. We ask different teams to register their developed services in the Service Registry. But we are not able to ensure that every team is registering all their services in the service registry. To enable better SOA governance, we want to enforce automatic service registration in the service repository by application teams, the idea is when ever they create a web service proxy on data power xg45 appliance, we want to invoke a web service call which will automatically create the service in the custom registry.
Our team is using IBM Data power xg45.
Is it possible to integrate IBM Data Power XG45 with the custom registry?
There is a few management interfaces to DataPower. What you can do is to poll those interfaces on a regular basis to extract any info regarding deployed web service proxies. It's pretty easy to setup a web service call from whatever app have you. If you poll the management interface often, it's pretty much the same as if DP would have created the registry entry itself.
A good e-book (although a bit old) is: http://www.redbooks.ibm.com/redpapers/pdfs/redp4446.pdf
For instance, the AMP interface can query available WSGateway services in a domain called RIV. The response will include info about referenced WSDL files, service names and referenced HTTP protocol handlers. For some details, you may need to query further and for some details, you may be able to figure out what to enter into the registry from the export.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.datapower.com/schemas/appliance/management/3.0">
<soapenv:Header/>
<soapenv:Body>
<ns:GetReferencedObjectsRequest>
<ns:Domain>RIV</ns:Domain>
<ns:ObjectClass>WSGateway</ns:ObjectClass>
<ns:ObjectName></ns:ObjectName>
</ns:GetReferencedObjectsRequest>
</soapenv:Body>
</soapenv:Envelope>

Send and Receive data to Web Server

What is a good way to Send data to a web server and then receive and port the data to a Microsoft Access database on the web server?
Sounds like you need some tutorials. Here's one.
http://www.devtoolshed.com/content/building-web-service-aspnet-35
Note that there are MANY different ways to create a web service and consume it.
Examples include: Generic Handlers (.ashx), MS Web Services (.asmx), WCF services (.svc), etc.
All of them have features / benefits. Probably the easiest one by far is to use generic handlers which are great for building RESTful type services.

How can we access windows service in webapplication using dot net

I need to read the data from the COM port in a web application, so I have written a Windows Service for reading data from serial ports. Now I need to access that data in a web application. Can anyone tell me how to access it? Is using threads the best way to do this or not? What other possible ways are there?
upendra
Get your Windows Service app to store the data to disk (xml or SDF for example). Your Web application could then access the same data store...
An idea would be to use an .Net Queue to read the values from. Read more here: http://msdn.microsoft.com/en-us/library/system.collections.queue(v=vs.71).aspx
Your other options would be to write the data to a file or a DB but then you have to write your own logic to handle disposing of read data which the Queue functionality will take care for you.
Cheers,
Stefan
In similar scenario I used self-hosted WCF service within windows service. In this way you expose api to control the service and get information from it.
You can read more about WCF self-hosting in Michele Leroux's article : link

Microsoft ESB Toolkit 2.0 for WCF Services

Can we have ESB Toolkit 2.0 to route the incoming messages to WCF services hosted in IIS?
I'm thinking of using content based routing, validation and transformation capabilities of ESB for WCF services.
Thanks
Of course, you can.
The routing mechanism from BizTalk ESB Toolkit 2.0 supports WCF services.
All WCF bindings are supported, including custom bindings as made available from the various WCF adapters.
All properties on the request-response EndPoint may be specified.
But the WCF service consumed from ESB Toolkit does not necessarily have to be hosted in IIS. As long as a corresponding binding exists for the service, you will be able to use it.
May I suggest that you question only calls for a yes or no answer. Do you have some difficulties using the Itinerary Designer?
You can definitely use ESB toolkit for route your messages to WCF service.
Both Static and BRE resolvers can be used and wold require you to pass the following parameters.
I am also using a map to create the WCF Service Request so I am using a Transform as well (as shown in the image) but you can use it without that as well.

What is the difference between an asp.net web method and a wcf service?

I'm new to .Net and do not understand the difference. Can someone point me in the right direction?
ASP.NET Web services was developed for building applications that send and receive messages by using the Simple Object Access Protocol (SOAP) over HTTP.
WCF is for enabling .NET Framework applications to exchange messages with other software entities. SOAP is used by default, but the messages can be in any format, and conveyed by using any transport protocol.
You can view ASP.NET web services as a subset of WCF services.
Here is a link comparing the two frameworks.
it is quite easy to know the differences.
ASP.NET Web Method is called ASMX [because of the file extension] (check 4GuysFromRolla about this, they have a good tutorial)
That technology makes you expose functions as a Web Service so you can connect it from everywhere and use it. But... you can't protect the data between server and client, you can send big files clear and know what happend, etc...
[Note] you can protect the access to the web service using certificates, but it is complicated but normally, in ASMX we use username / passsword.
in WCF, you are in the different world about Web Services,and this s the best technology in .NET to expose Services (can you see the difference... Services! not Web Services), WCF does not need IIS to run, it can run as a System Service on the server, using a console ambient (like command line), etc, so we say that WCF is a Service not Web Service. Remember ASMX need IIS to run.
with WCF you can use SSL to encrypt the communication (to do that in ASMX you need to use WSE - Web Services Enhancements), you can send big files and securely (to do that in ASMX you need to use MTOM - Message Transmission Optimization Mechanism).
you can set the transmission preferences just changing one line of code, the security is much higher, etc, etc :)
hope you get a better general overview with this, but there is much more.
bottom line: to expose Web Services that you do not need to protect, you can use ASMX, no problem at all, but if you need to protect the communication somehow, do it in WCF!
link: you can read here some performance comparative between the 2 services
They are two different frameworks for writing services. WCF is generally more flexible and provides configurable options for what protocols are used, how the service is hosted and a variety of security options. ASMX offers SOAP based services. Generally WCF is also more performant. In general ASMX is easier to use and generally has less of a learning curve.
Here is a MSDN forum discussion on the topic.
Here are the getting started pages for ASMX and WCF.
In addition to the above responses, WCF was created to replace .NET Remoting in .NET 3.0 and beyond. In addition to SOAP, REST, POX, etc. web services in various formats (e.g. XML and JSON), WCF also offers MSMQ and Named Pipes. ASMX, as mentioned above, provides only SOAP-based XML web services.
You would need to delve into .NET Remoting for other types of communication protocols. For additional information, you should check out Pro C# 2008 and the .NET 3.5 Framework. It's a great resource, and you can get the chapters from the previous books that cover .NET Remoting, and other replaced features.
Here's a new, big, difference: Microsoft now considers ASMX web services to be "legacy" technology. See "XML Web Services Created Using ASP.NET and XML Web Service Clients".
Web Services
It Can be accessed only over HTTP
It works in stateless environment
WCF
WCF is flexible because its services can be hosted in different types of applications. The following lists several common scenarios for hosting WCF services:
IIS
WAS
Self-hosting
Managed Windows Service
They are two different things all together. WCF is a more generic framework through which you can write one service type component and deploy it in many ways (even as an Asp.Net Web Service).
Here's a brief thread about this http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/2d6a7ff2-f15c-4599-a389-a81cfffcc852/
I had the same problem.
I found the book Microsoft Windows Communication Foundation Step by Step to be really good.
If you just want to do the traditional webservice thing using WCF, then Chapter 1 of that book will show you exactly how to do that (write service, test, deploy, use service).
Its written for VS2005, but I'm using vs2008 and found it even easier.
There's a lot more to WCF, but that book is a good start.
Main Differences between Web service and WCF are listed below.
Web Service : Web Service is an application that is designed to interact directly with other applications over the internet.
1) [WebService] and [WebMethod] attributes defines a web service and methods.
2) It Can be accessed only over HTTP.
3) Hosted in IIS.
4) Support security services.
5) Can not be multithreaded.
6) Only Used Soap or XML.
7) System.Xml.serialization name space is used for serialization
WCF :Windows Communication Foundation (Code named Indigo) is a programming platform and runtime system for building, configuring and deploying network-distributed services.
1) [ServiceContract] and [OperationContract] attributes defines a web service and methods.
2) Accessed through HTTP, TCP, MSMQ, P2P, Named pipes
3) Hosted in IIS, Self-Hosting ,WAS and Windows Service.
4) Can be multithreaded via service behavior class.
5) System.Runtime.Serialization namespace is used for serialization
6) Supports different type of bindings like BasicHttpBinding, WSHttpBinding,WSDualHttpBinding etc.
7) Support security services, reliable messaging, transactions, AJAX and REST Support

Resources