Forum Replies Created
-
AuthorPosts
-
January 18, 2009 at 12:06 PM in reply to: Transmitting .net class type from one application to WCF service via BizTalk orchestration #21521
The types may be different because BizTalk generates a different namespace. Note that within BizTalk the “types” are message types, not .NET class types. If you look at the message types listed in your application, you will be able to see if there are different namespaces. You can create a simple map from the message type that BizTalk recieves to the target message type. Place the map in your send port.
The error is pretty general. I would try and debug the functoid. If you are testing it in Visual Studio just attach to the exe and put a breakpoint in the relevant code.
January 18, 2009 at 8:10 AM in reply to: BizTalk 2006 R2 WCF-basicHttp adapter configuration – Getting message in service – with null value #21519I’m now accepting the entire message as the WCF method parameter and am manually serializing only the Body ( message.WriteBody(xmlWriter) ). WHen I examine the output XML file, I’ve got an extra XML node in the content that is preventing me from deserializing again:
<s:Body xmlns:s=”http://schemas.xmlsoap.org/soap/envelope/”>
<My XML content…>
</s:Body>
If I manually strip that section out of the XML file, it deserializes just fine. I strongly suspect the deserialization the WCF service handles automatically is having very same issue.
Zx7R,
Are you getting the same results as I am with your application?
January 17, 2009 at 5:17 AM in reply to: BizTalk 2006 R2 WCF-basicHttp adapter configuration – Getting message in service – with null value #21518…but I should add that that doesn’t help me or Zx7R here in the slightest. The message passed needs to be deserialized to the type that we are expecting. Someone here has got to know this…
How do we get our messages to deserialize properly?
January 16, 2009 at 12:24 PM in reply to: BizTalk 2006 R2 WCF-basicHttp adapter configuration – Getting message in service – with null value #21516Note:
If I change the X12_00401_271 type of the parameter to type “System.ServiceModel.Channels.Message”, I can see the contents just fine.
January 16, 2009 at 11:18 AM in reply to: BizTalk 2006 R2 WCF-basicHttp adapter configuration – Getting message in service – with null value #21515I am having the same issue (WCF Contract Mismatch with BizTalk 2006 R2 EDI XML Schema). Rather than start a new thread, I’ll just jump in here.
I’m kind of new to BizTalk and to WCF and am having what I believe to be a small issue with deserializing a message in a WCF service. What I have is a very basic sample application just trying to get the concept working:
A BizTalk 2006 R2 orchestration is up and running that will receive an X12 270 Eligibility Request message (schema from the MicrosoftEdiXSDTemplates.exe file that comes with BizTalk 2006 R2), sends the request to a trading partner via a Send/Receive port, and sends the X12 271 Eligibility Response (once received from the trading partner) to a send port.
When the Send Port is configured to simply write the X12 271 response to an XML file on disk, the whole thing works great. However, what I really way is to send it to a WCF service. So, I created the below, very simple, WCF service hosted in a console application (only added reference is System.ServiceModel). When the process is executed, the web service does get called, but the “response” (message) parameter on the “WriteResponse” method is always null (although if I check the message in the BizTalk admin tool, it looks good), and I get the error detailed at the bottom of this post. What am I missing?
*******************
Service.cs
*******************
[ServiceContract(Namespace=”http://myuri.org”),
XmlSerializerFormat(Style = OperationFormatStyle.Document, Use = OperationFormatUse.Literal)]public interface IResponseToSQL
{
[OperationContract(IsOneWay = true, Action = “http://myuri.org/IResponseToSQL/WriteResponse”)]
void WriteResponse(MyNamespace.X12_00401_271 response);}public class ResponseToSQL : IResponseToSQL
{
#region IResponseToSQL Memberspublic void WriteResponse(MyNamespace.X12_00401_271 response)
{
Console.WriteLine(“WriteResponse method called…”);if (response == null)
Console.WriteLine(“The response message is null.”);
else
Console.WriteLine(“The response message is not null. Save the response to SQL…”);
}
}*******************
Program.cs
*******************
class Program
{
static void Main(string[] args)
{
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine(“ResponseToSQL service is up and running with the following endpoints:”);using (ServiceHost host = new ServiceHost(typeof(EligibilityLookup.WCF.Host.ResponseToSQL), new Uri(“http://localhost:8000/ResponseToSqlService”)))
{
// HTTP
host.AddServiceEndpoint(typeof(EligibilityLookup.WCF.Host.IResponseToSQL), new BasicHttpBinding(),
“basic”);// WS Http
host.AddServiceEndpoint(typeof(EligibilityLookup.WCF.Host.IResponseToSQL), new WSHttpBinding(),
“ws”);// Named Pipes
host.AddServiceEndpoint(typeof(EligibilityLookup.WCF.Host.IResponseToSQL), new NetNamedPipeBinding(),
“net.pipe://localhost/ResponseToSqlService/pipe”);// TCP/IP
host.AddServiceEndpoint(typeof(EligibilityLookup.WCF.Host.IResponseToSQL), new NetTcpBinding(),
“net.tcp://localhost:8082/ResponseToSqlService/tcp”);host.Open();
foreach (System.ServiceModel.Description.ServiceEndpoint endPoint in host.Description.Endpoints)
Console.WriteLine(endPoint.Address.ToString());Console.WriteLine(“Press a key to terminate host.”);
Console.ReadLine();
}
}
}I also generated a class file using XSD.exe to get the X12_00401_271 class. I generated it off the same XSD schema I used in the BizTalk orchestration to define the response message (which, again was plucked out of the MicrosoftEdiXSDTemplates.exe file that comes with BizTalk 2006 R2). The command I used was:
xsd.exe X12_00401_271.xsd /c /namespace:MyNamespace
*******************
BizTalk 2006 R2 Send Port Configuration
*******************
–Main Property Page–
Type: WCF-BasicHttp
Send Handler: BizTalkServerApplication
Send pipeline: PassThruTransmit
(rest of settings are default)–Type Configuration (WCF-BasicHttp)–
Endpoint Address:http://machinename:8000/ResponseToSqlService/basic
SOAP Action Header Action: http://is.org/IResponseToSQL/WriteResponse
(rest of settings are default)*******************
Resulting Error (from Windows Event Viewer)
*******************
Event Type: Error
Event Source: BizTalk Server 2006
Event Category: BizTalk Server 2006
Event ID: 5754
Date: 1/16/2009
Time: 1:08:50 PM
User: N/A
Computer: VIRTUALBIZTALK
Description:
A message sent to adapter “WCF-BasicHttp” on send port “WcfResponseSendPort” with URI “http://machinename:8000/ResponseToSqlService/basic” is suspended.
Error details: System.ServiceModel.CommunicationException: The server did not provide a meaningful reply; this might be caused by a contract mismatch, a premature session shutdown or an internal server error.Server stack trace:
at System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result)
at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result)
at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)
at System.ServiceModel.Channels.ServiceChannel.EndRequest(IAsyncResult result)Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at System.ServiceModel.Channels.IRequestChannel.EndRequest(IAsyncResult result)
at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.RequestCallback(IAsyncResult result)
MessageId: {7FD75D76-04C8-4136-987D-F674C4321611}
InstanceID: {A6B69FCF-D16A-47A2-8CB1-A6F17327E433}For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
Thanks in advance!
January 15, 2009 at 5:53 AM in reply to: Mapping an Optional Element w/ Required Attribute to an Optional Element #21510Thanks, the loop worked just fine. I was hoping it was something simple I was missing.
January 15, 2009 at 2:41 AM in reply to: Mapping an Optional Element w/ Required Attribute to an Optional Element #21509Just insert a Loop functoid or a Logical Existence functoid between ANode and BNode in addition to the value link between @att and BNode. That should do it. Test both and compare the xslt, doing that, I’d pick the loop.
//Niklas Häggström – Connecta AB
January 13, 2009 at 12:59 PM in reply to: Type Load Exception When trying to access Distinguished fields #21506Have you made sure that the element associated with the distinguished field is in the message? If so, is the data type of the element unusual?
January 11, 2009 at 7:43 AM in reply to: BRE Development – .NET based Actions reflect changes only after VS re-opening #21500Hmm, in the meantime it seems to me that Visual Studio / MSTest is the problem. If I call the “changed sources and rules” from within a console application the changes are always reflected immediately. Same holds true if I let run the tests via debug. But if I run the tests just by execute the changes are not reflected. I’ll will investigate further. Finally its not BTS/BRE.
sure, you can have an entire biztalk project in the messaging engine. Of course, unless you create a custom pipeline component and place it in a custom pipeline, the messaging engine will be strictly a routing engine.
January 10, 2009 at 4:38 PM in reply to: BRE Development – .NET based Actions reflect changes only after VS re-opening #21498designate your project to restart the host instance that its being deployed to or restart it yourself and everything will be refreshed everytime
January 9, 2009 at 9:07 AM in reply to: BTS.MessageType problem in Receive Shape Filter expression. Need urgent Help #21495This is true with both ‘BTS’ & ‘EDI’ (‘CompanyX.BTS.Project’ or ‘CompanyX.EDI.Project’) Avoid creating any of your namespaces with those in it – Lame, but it will save you many headaches.
January 9, 2009 at 7:03 AM in reply to: How to publish the Orchestration if we are using SQL Adapter #21494Even I am not sure, if I understood your question. Let me add something more.
I did not get your question “how to use SQL Adapter orchestration as web services”. Note that you are publishing a logical port on the orchestration as web service. If you already had SQL Adapter then now your orchestration logical port can get the same message either from SQL Adapter or web service
January 9, 2009 at 5:40 AM in reply to: How to publish the Orchestration if we are using SQL Adapter #21492Thanks Wearsy,
-
AuthorPosts