You could use a helper class, that holds your cached sessionId. Richard Seroter did something similar when integrating BizTalk with SalesForce, look at
this blogpost. About halfway is the class ForceToken.

Please mark the post answered your question as answer, and mark other helpful posts as helpful, it'll help other users who are visiting your thread for the similar problem, Regards -Rohit Sharma (http://rohitt-sharma.blogspot.com/)

I am getting error 'Output of the transform does not match the expected number of output parameters', when I try to map followings and assign to SEND shape of type MsgReadContacts. Any idea why I am getting this?

I am getting error 'Output of the transform does not match the expected number of output parameters', when I try to map followings and assign to SEND shape of type MsgReadContacts. Any idea why I am getting this?

Please mark the post answered your question as answer, and mark other helpful posts as helpful, it'll help other users who are visiting your thread for the similar problem, Regards -Rohit Sharma (http://rohitt-sharma.blogspot.com/)

Pabitra, All you have to do it to get the get the session Id from the response message(you can access the header of response by using the
WCF.InboundHeaders property) and replace it in string being used to set the
OutboundCustomHeader by using System.String.Format("...{0}...",variableHoldingSessionIDFromResponse)

Please mark the post answered your question as answer, and mark other helpful posts as helpful, it'll help other users who are visiting your thread for the similar problem, Regards -Rohit Sharma (http://rohitt-sharma.blogspot.com/)

Thanks. So do you think I do not need to construct MsgSessionHeader. How do I construct MsgReadContacts with nothing (all optional fields). All I need is to construct MsgReadContacts with session header (which has value session id) and pass MsgReadContacts
to WCF adapter. I would not like to use LoadXML with hard coded strings.

You are correct. I get following error after performing 'Test Map'. However as I discussed y'day, I would like to construct MsgReadContacts with nothing in Mapper. How would I would do this in Mapper, which is my second output message, first one is session
header.

Construct shape with a Transform followed by an Assignment shape. For the Transform select MsgLoginResponse as input and MsgReadContacts.parameters, MsgReadContacts.sessionHeader as output. In the map use a looping functoid as I explained before and link
the loginResponse.return to the sessionHeader.sessionId.

Thank you very much for your response. But I could not understand how to set MsgReadContacts.parameters and MsgReadContacts.sessionHeader as output. While creating a mapper,I set MsgSessionHeader and MsgReadContacts for destination transforms.

So how to set MsgReadContacts.parameters and MsgReadContacts.sessionHeader as destination transforms. Please reply.

I got following same error 'Output of the transform does not match the expected number of output parameters'.

xlang/s engine event log entry: Uncaught exception (see the 'inner exception' below) has suspended an instance of service 'ReadBrontoContacts.BrontoLogIn(2d3792eb-9000-aaf1-860b-977333e67f4f)'.
The service instance will remain suspended until administratively resumed or terminated.
If resumed the instance will continue from its last persisted state and may re-throw the same unexpected exception.
InstanceId: 809088de-6f32-4ef0-98f9-3e989144c5bd
Shape name: Create ReadContacts
ShapeId: b7e40dc7-1799-4746-91c0-d44d3cbf79ea
Exception thrown from: segment 2, progress 9
Inner exception: Error encountered while executing the transform ReadBrontoContacts.Transform_1. Error:Output of the transform does not match the expected number of output parameters..

Exception type: XTransformationFailureException
Source: Microsoft.XLANGs.Engine
Target Site: Void ShredXmlDocument(System.IO.Stream, System.Object[], System.String, System.Xml.XmlDeclaration)
The following is a stack trace that identifies the location where the exception occured

xlang/s engine event log entry: Uncaught exception (see the 'inner exception' below) has suspended an instance of service 'ReadBrontoContacts.BrontoLogIn(2d3792eb-9000-aaf1-860b-977333e67f4f)'.
The service instance will remain suspended until administratively resumed or terminated.
If resumed the instance will continue from its last persisted state and may re-throw the same unexpected exception.
InstanceId: 5066812d-c7a3-4b35-95ff-f2f940099f30
Shape name:
ShapeId:
Exception thrown from: segment -1, progress -1
Inner exception: Exceptions.Types.FaultReceiveException

Exception type: FaultReceiveException
Source: Microsoft.XLANGs.BizTalk.Engine
Target Site: Void VerifyTransport(Microsoft.XLANGs.Core.Envelope, Int32, Microsoft.XLANGs.Core.Context)
The following is a stack trace that identifies the location where the exception occured

Is this exception related to readContactResponse? I did not create mufti part readContactResponse. I create it from schema? Please reply.

xlang/s engine event log entry: Uncaught exception (see the 'inner exception' below) has suspended an instance of service 'ReadBrontoContacts.BrontoLogIn(2d3792eb-9000-aaf1-860b-977333e67f4f)'.
The service instance will remain suspended until administratively resumed or terminated.
If resumed the instance will continue from its last persisted state and may re-throw the same unexpected exception.
InstanceId: 5066812d-c7a3-4b35-95ff-f2f940099f30
Shape name:
ShapeId:
Exception thrown from: segment -1, progress -1
Inner exception: Exceptions.Types.FaultReceiveException

Exception type: FaultReceiveException
Source: Microsoft.XLANGs.BizTalk.Engine
Target Site: Void VerifyTransport(Microsoft.XLANGs.Core.Envelope, Int32, Microsoft.XLANGs.Core.Context)
The following is a stack trace that identifies the location where the exception occured

I have added fault but it is not caught. In suspended instances, I found following error.

<soap:Fault xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><faultcode>soap:Client</faultcode><faultstring>107: There was an error in your soap request. Please examine the request and try again.</faultstring><detail>There
was an error in your soap request. Please examine the request and try again.</detail></soap:Fault>

The session header I am sending is : <headers><ns1:sessionHeader xmlns:ns1="http://api.bronto.com/v4"><sessionId>20f47f3d-68cc-47ec-b056-3aaf48e1016e</sessionId></ns1:sessionHeader></headers>

Which is fine I think.

The output of Construction (Transform + Assignment) goes to a SEND shape. What should be the type of this shape, multi part MgsReadContacts or MgsReadContacts.parameters? I set it to multi part MgsReadContacts and same sent to send web service request whose
type of also same multi part MgsReadContacts. Is this correct?

Can you elaborate on how you created the Multipart MessageType and furthermore how the deployment looks like, i.e. how did you configure the sendport to Bronto?

About the creation of the Bronto mulitpart messagetypes; one normally would consume the wsdl of the webservice you want to call from BizTalk. This way the BizTalk WCF Service Consuming
Wizard will create the necessary artefacts like message- and porttypes, which you can use to call the webservice.

Any idea how to avoid message transform and assignment in Orchestration? Can SOAP header be set in WCF Basic Http Adapter level? I was told to get session id through functoid. Somebody achieved this through 'Get Application Value' DB functoid. I was also
to avoid transform and assignment construct in Orchestration. Any idea how to do this?

The separation of the different artifacts in separate projects is a best practice, where the Maps project in your case probably contains the maps for transforming the external schema into the internal one and vice versa.

You say 'transforms and assignments' are not defined in Orchestrations', do you have more restrictions on using other artifacts form the toolbox? As I think these are common shapes to use within an orchestration.

What about creating a folder within your Orchestrations project, that will hold maps solely used within orchestrations. These maps will transform messages used in the orchestrations.

>>> where the Maps project in your case probably contains the maps for transforming the external schema into the internal one and vice versa.

Correct.

>>>You say 'transforms and assignments' are not defined in Orchestrations', do you have more restrictions on using other artifacts form the toolbox? >>>As I think these are common shapes to use within an orchestration.

Other artifacts are used. 'transforms and assignments are used in Orchestrations but very few. In most of Orctrestration these are not used.

Orchestrations project has only reference to 'Internal schema' project. Does not have reference to Maps and 'External Schema' Projs.

>>>What about creating a folder within your Orchestrations project, that will hold maps solely used within orchestrations. These maps will transform >>>messages used in the orchestrations.

As I said earlier Orchestrations does not have reference to 'Maps' project. Maps are bounded to Send port's inbound and outbound mappers properties. The complex logic is there in mapper through functoids. Even 'session id' is retrieved

>>>>As I said earlier Orchestrations does not have reference to 'Maps' project. Maps are bounded to Send port's inbound and outbound mappers properties. The complex logic is there in mapper through functoids. Even 'session id' is retrieved

I did not meant a reference to the Maps project, but a separate folder in the Orchestrations project named 'Maps'.

I do not see how you would use functoids to get sessionId and get that into the SoapHeader form a map on a SendPort.

You could use a helper class, that holds your cached sessionId. Richard Seroter did something similar when integrating BizTalk with SalesForce, look at
this blogpost. About halfway is the class ForceToken.

Can I achieve this without multi part message? Because the project I am working, this type of message is not used. There are so many restrictions. I have posted some new questions today. Please go though those in your free time and reply if possible.