Sdílet prostřednictvím


Is there a way to configure one send port to send a message to a document library based on a parameter?

This question comes up quite often that it deserves its own post. Is there a way to configure one send port to send a message to a variable destination based on a parameter? For instance when using WSS adapter, can you send a message to a different document library based on the message that's being processed?

The answer is yes, it's possible to do this in two ways:

  • using dynamic send ports, the destination URI and the configuration of the send port can be set programatically in the orchestration for every outgoing message. This method has the advantage that no ports have to be pre-created.
  • using role-links and parties. For each party you need to pre-create and configure a pyshical send port. You will have pretty much a party per destination. You enlist the parties in the appropriate role. Then, in the orchestration the only thing that you need to do is set the party associated with the role-link. The physical send port of the party associated with the role-link will be used to process the outgoing message.

I included below more information on how to do this using dynamic send ports which is the more simple & frequent approach.

The URL for a WSS adapter dynamic send port will be something like this:
     'wss://ServerName/sites/MySite/MyDocumentLibrary/'  if you installed the web service on an HTTP site
     'wsss://ServerName/sites/MySite/MyDocumentLibrary/' if you installed the web service on an HTTPS site (notice the additional s in wsss://).
 
and you can set it programatically from the orchestration (like below) every time you sent out a message
     dynamicSendPortName(Microsoft.XLANGs.BaseTypes.Address) = "wss://ServerName/sites/MySite/" + lookedupDocLibName;
 
The rest of the send port configuration information must be set on the outgoing message using the Config* context properties documented here
https://msdn2.microsoft.com/en-us/library/aa547920.aspx

For instance:
    outgoingMsg(WSS.Filename) = "file1.xml";
    outgoingMsg(WSS.ConfigOverwrite) = "yes";
    etc.
 
Video 04-WSSAdapter-PropsInOrchestration.wmv shared here includes one such dynamic send port example
https://blogs.msdn.com/ahamza/archive/2006/04/18/WssAdapterVideosWebcasts.aspx

Comments

  • Anonymous
    March 08, 2007
    Thanks for posting this information. My next question is this; I plan to drop an xml file into one of about 160 document libraries depending on what the Orchestration decides. I've found that in order for InfoPath 2003 to recognise the xml I have to create the InfoPath form first based on the schema, then publish to a document library on Share Point. Would I have to publish the same form 160 times, or is there a quicker way to do this?
  • Anonymous
    March 08, 2007
    The comment has been removed
  • Anonymous
    March 12, 2007
    I've created an InfoPath form using the XSD from my Biztalk project and published it to a folder called 'InfoPathSolutions' under the following URL: http://servername/InfoPathSolutions/Expenses.xsn">http://servername/InfoPathSolutions/Expenses.xsn. I want to use this as the template for the XML that comes in via Biztalk.Within Biztalk I've created a dynamic send port and configured it in an Expression shape. In there I've set the following:WSS.ConfigOfficeIntegration = yesWSS.Url = http://servername/WSS.ConfigTemplatesDocLib = http://servername/InfoPathSolutionsWSS.ConfigTemplatesNamespaceCol = NamespaceI've then created another site underneath my home site called http://servername/NewSite. Within this I've created a document library called 'Expenses' and I want to drop XML files here and use the InfoPath template to view them. But I keep getting an error in HAT saying that it can't find the folder I've specified as storing the templates. I've tried different combinations of url / non - url but it's almost as though I can't store the templates on a different site to the xml files. Is this true?Mark.
  • Anonymous
    March 12, 2007
    Yes it's true. The templates must exist on the same site as the XML document.Also you need to specify the name of the document library and not the full/relative URL.When creating WSS adapter ports you need to pay attention to the field names, if they don't mention URL then you are required to enter a name. Some fields require names others require relative or full URLs.
  • Anonymous
    May 21, 2007
    Hi... I´m trying to communicate BizTalk - Sharepoint following the steps that you show in your video... the following problem appears when the receive location poll to sharepoint:The adapter "Windows SharePoint Services" raised an error message. Details "Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'.any help?Thank you.
  • Anonymous
    May 24, 2007
    The comment has been removed
  • Anonymous
    July 18, 2007
    I am facing the same problem with sharepoint adapter.I tried to doing it above. It didn't work. can anybody please help me out in this
  • Anonymous
    July 18, 2007
    Did you install and configure the web service?Did you check your receive location is using the same port number as the II site where you installed the web service?Did you browse with IE to the web service and saw that it works?If all of these worked, what are the errors that you see in the event viewer or in BizTalk MMC console for the outgoing message?If some of the above didn't work, what was the error that you got back?
  • Anonymous
    November 14, 2007
    Hello Adrian!I've been trying to set the dynamic address for the WSS adapter, but at runtime the adapter can't find the document library. Here is the URL for the document library:http://vpc:27298/sites/AIBErrorHandling/Shared%20Documents/Forms/AllItems.aspxIn SharePoint, I have changed the Shared Documents document library name to AIBErrors. I have 6 "System Source" folders in the AIBErrors doc library, and 3 "Error type" folders under each of those. I am trying to dynamically direct files to the correct folder based on source and type. Here is the dynamic configuration for setting the destination:SendCbeErrorToSharepoint(Microsoft.XLANGs.BaseTypes.Address) = "wss://servername:27298/sites/AIBErrorHandling/AIBErrors/" + cbeError.errSystem + "/" + cbeError.errType;Here is the error I get when I run the application:[Microsoft.SharePoint.SPException] The virtual server that is referenced here is not in the config database.This error was triggered by the Windows SharePoint Services receive location or send port with URI wss://servername:27298/sites/AIBErrorHandling/AIBErrors/Agile/Application.Windows SharePoint Services adapter event ID: 12310I have tried hard-coding the wss uri, as well as trying to create a different top level document library as a destination. No success in either case...In your video you use the path:"wss://demobt/sites/WSSAdapterWalkthrough/Lists/Tasks"In all of the examples I've seen online for documents they say to use the format:"'wss://ServerName/sites/MySite/MyDocumentLibrary/"Is there a prefix like "Lists" that should preface the actual doc library name?TIA for your help!
  • Anonymous
    November 19, 2007
    The comment has been removed
  • Anonymous
    June 04, 2008
    Take out the space in the column name