Eleven Emerging Ideas for SOA Architects in 2007

http://www.soanowjournal.com/bestpractices.html

What is Service Oriented Architecture? SOA

Saving your SOAP Request in ONE STEP

Do you want to save the SOAP request to your webservice!!!
And you don’t want to write a huge lines of code to do that process!!!

Download this
dll , and just add the following attribute before your method:
[WebMethod, SoapLogger("C:\\soap.log")]

* WebMethod attribute: Attaching the WebMethod attribute to a Public method indicates that you want the method exposed as part of the XML Web service

*SoapLogger("C:\\soap.log"): Attaching the SoapLogger attribute to a Public method indicates that you want the monitor the SOAP request to that method and you want to save this request in that path : 'C:\\soap.log'

don’t care about the code just use the dll , and enjoy soaping... :D

Creating SOAP Header Schemas in BizTalk 2006 (Part 3)

Now we are go to create an Orchestration that can send a request to a Web Service that can process a SOAP Header "see Creating SOAP Header Schemas in BizTalk 2006 (Part 2) ":

1) You have to define a schema , the schema type of it is Property and the target namespace is http://schemas.microsoft.com/BizTalk/2003/SOAPHeader "see Creating SOAP Header Schemas in BizTalk 2006 Article Part(1)" ,
but you have to add a Child Field Element its name exactly the name of SOAP header class in the web service that will Process the SOAP Header

2)Now put your send , receive , assignment , and send-receive port to the web service that process the SOAP Header , as shown in the below image :


3) The Important part here is in the Assignment shape; let us check the code inside it:

msgRequest(SOAPHeader) = "HELLO AM IN HEADER ";

*msgRequest : is a message of type web messages type ,which is the type of the web service tha process the SOAP header type


*SOAPHeader : The Schema that we have define


*"HELLO AM IN HEADER " : the vlaue that will be send to the web service


Now Congratulations, you can now Biztalking ...: D

Creating SOAP Header Schemas in BizTalk 2006 (Part 2)

First, we have to know, how to Build a web service That Processes SOAP Headers:

---Define and Process SOAP Headers:

1. To define a class representing a SOAP header
-Create a class deriving from the Soap Header class with a name matching the root element for the SOAP header. Then Add public fields or properties, matching the names and their respective data types for each element in the SOAP header. For instance, given the following SOAP header, the class following it defines a class representing the SOAP header.

public class mySoapHeader : SoapHeader
{
public string HeaderValue;
}
2. To process SOAP headers within a Web service
-Add a public member to the class implementing the Web service of the type representing the SOAP header.


[WebService(Namespace = "http://ITWorx/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class Service : System.Web.Services.WebService
{
public mySoapHeader MyHeaderValue;

}
- Apply a
SoapHeader attribute to each Web service method that intends to process the SOAP header. Set the MemberName property of the SoapHeader attribute to the name of the member variable created in the first step.

[SoapHeader("MyHeaderValue",Direction=SoapHeaderDirection.In)]
public string GetString()
{
}

-Within each Web service method that the SoapHeader attribute is applied to, access the member variable created in the first step to process the data sent in the SOAP header.

[SoapHeader("MyHeaderValue",Direction=SoapHeaderDirection.In)]
public string GetString()
{
if (MyHeaderValue != null){
return MyHeaderValue.HeaderValue;
}
else
return "Invalid information in SOAP Header";

In the Next article in sha'a ALLAH, I will explain how the orchestration could send a request includes a custom value in the SOAP Header