Thursday, April 02, 2009

Enriching BizTalk Message in an Orchestration

This is a simple post, but will help me remember what i did: (I apologize if this is high level)

There's at least 3 options:
1. If what i need to add is a dozen properties then distinguish them and add them in construct message expression (what i went with)
2. Use multi message map within the orchestration
3. Use BRE to modify the message (why the hell would you introduce a new moving big monster to your project?! bad idea IMHO, but if you have to)

BizTalk 2009 Oracle EBS Adapter 2.0

I guess i am one of the very first people to work with the new WCF LOB Adapter Pack 2.0 that ships with BizTalk 2009.  I have been working with the RC release.

I gotta tell you, there's a whole lot of gotchas on Oracle's side to get it rolling.  The version of documentation i had did not mention i need Oracle Client 11g with Patch Set 2.111.7 (very important).  

If you have anything earlier than that you will get the message:
Connecting to the LOB system has failed. 
Could not load file or assembly 'Oracle.DataAccess, Version=2.111.7.0, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. The system cannot find the file specified

Another gotcha that i ran into is when you try to add a generated item (a schema) to your BizTalk project and if you choose to "consume adapter service" then you can add a nice schema.  Now if you want to add another item even for a different Oracle API's, your project will not recognize what you added earlier.  

Work around: instead of choosing "consume adapter service" go for "add adapter metadata".  Now, i am not sure why one would work and the other wouldnt. and i am also wondering why they have 2 things that kind of work very similarly.

More to come...

Wednesday, May 16, 2007

Report Viewer Control

It's a very nice control to drop on your winForm. However, it's missing what most people think is a basic function, RENDER!!!
so to get the report to render I had to call ReportViewer1.RefreshReport(); method since it does not seem to be making a call to render!

the parameters are: report server: http://localhost/reportserver
and //

Tuesday, May 01, 2007

.NET 2.0/3.0

How to change the size of the paper

PageSettings.PaperSize.Kind to Custom, its saying its a Read Only property and if you want to change the size to any other with

PageSettings.PaperSize.Width

Or

PageSettings.PaperSize.Height

PrintDocument1.DefaultPageSettings.PaperSize = New System.Drawing.Printing.PaperSize(PaperSizeName, PageWidth, PageHeight)

Tuesday, August 22, 2006

IIS 5.0 CSR generated too long (invalid)

Problem: when you go to the site's property under IIS, you pick director security, then server certificates and do generate a CSR (certificate signing request) you may get a file that is too long and will fail to validate. what you do is create a dummy site, generate the request then process that same pending request in the dummy site. after that go to your site and choose to replace certificate. pick the cert that you just processed and you're done!take a look at this:
Thawte Support Site
and this Thawte support to generate the CSR

hope this helps!

Friday, February 03, 2006

Display PDF document within an asp.net page with other controls

Displaying PDF files in ASP.NET is a simple task when you want the PDF to take the entire page. Or even easier when you want the user to have the option of open/save PDF document.
Recently I was required to write an ASP.NET page to display the messages sent using BizTalk Server 2005 orchestration.
Background: I am developing a BAM custom page to let the users view the messages and re-send them again as they desire.
the page had to have a big text box showing the incoming message, and another:
1. text box to display the outgoing message in case of text or XML formats
or
2. PDF viewer if the document is PDF.

The solution to this was to use an iFrame that calls the same page referencing the PDF document to load it.
watch.. watch the magic
create an iFrame
(just look it up somewhere else... it's rendering here.. i dont wann deal with it now)

and in your C# code behind file:

if (Request.Params["pdf"] != null) DisplayPDF();
else
{
TextBox1.Visible = true;
}

public void DisplayPDF()
{


//using the BamManagementService to get the data
localhost.BamManagementService oBMS = new localhost.BamManagementService();
oBMS.UseDefaultCredentials = true; //this line gets rid of your 401 unauthorized access error when using the web service

localhost.Reference oRef = new localhost.Reference();
//
oRef = oBMS.GetReferences("EndToEnd", "EndToEndActivity", "1", "MessageBody")[0];
//oRef = oBMS.GetReferences(" ", "Ordering Progress Status", "5ce82c99-5af9-4913-ad9a-33f9a2e66600", "MessageBody")[0];
String PDFString = oRef.LongReferenceData.ToString();
//my PDF is encoded so im decoding it.. you may skip this
byte[] Bytes = new byte[PDFString.Length];
Bytes = System.Convert.FromBase64String(PDFString);

//just in case Response has stuff in it
Response.Clear();
//to show PDF because it's foreign to .NET
Response.ContentType = "application/pdf";
//writing the stream of bytes to create the PDf
Response.BinaryWrite(Bytes);
Response.Flush();
}


im sure i'll run into this.. so im documenting it!
have fun hunting BAM

Wednesday, January 25, 2006

{"The request failed with HTTP status 401: Unauthorized."}

while trying to use the BamQueryService web service to create a custom BAM interface in BizTalk 2006 i ran into:

{"The request failed with HTTP status 401: Unauthorized."}

I tried giving IUSR_*** permissions to the BAM site but that did not work for me.
I found out that the web user credentials have to be given to the service before.
To fix this I added:


localhost.BamQueryService oBQS = new localhost.BamQueryService();

THIS LINE: oBQS.UseDefaultCredentials = true;

oBQS.GetInstanceData("ManagerView", "Watch Cert", query, 60);

I just wanted to add a solution to this other than the ones I've seen online, just in case someone runs into it.
g'luck

Wednesday, January 11, 2006

why blog?

I have been blogging for about 2 years now although I do not really have a writing style. In fact, people are annoyed that my style sounds "chatty".
Currently I started a new job as a Jr. consultant. My intention is to document my notes about the job, management, and technologies that I work with. Later, say in a couple of years, I want to compare my knowledge, my writing, and my understanding of both technical and managerial aspects of the job!
I will be talking about .NET, BizTalk Server, SQL Server and other computer-related Microsoft, and non-MS technologies..
If you are reading this bare with me for a while (a couple of years!)

Regards,