|
Home > Archive > BizTalk Server Orchestration > April 2006 > BTS2004: Sharepoint adapter, setting file name (Xpath) - how
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
BTS2004: Sharepoint adapter, setting file name (Xpath) - how
|
|
|
| When sending a document using the Sharepoint adapter, we want to set the
output file name. How do we set up an Xpath for a filename that retrieves an
attribute from this message:
<?xml version="1.0" encoding="utf-8"?>
<ns0:Order xmlns:ns0="http://site/schemas/PO">
<ns0:PO>
<ns0:poNo>1</ns0:poNo>
<ns0:name>OrderName</ns0:name>
</ns0:PO>
</ns0:Order>
| |
| Neal Walters 2005-01-13, 5:51 pm |
| There are two ways to set the output filename:
1) You can change the incoming filename:
mProcessingReportIn(FILE.ReceivedFileName);
Then on your send port use the macro %Source_File_Name%.
2) Use dynamic ports - set this property of the output port name:
oprtTriggerBackSendFile(Microsoft.XLANGs.BaseTypes.Address) =
@"file://" + vTriggerFileName;
I don't quit understand your attribute question (there is no attribute in
your XML other than the namespace itself), but you will probably have to ue
the local-name parameter in your Xpath. See the blog at my site below.
Neal Walters
http://Biztalk-Training.com
"JPS" wrote:
> When sending a document using the Sharepoint adapter, we want to set the
> output file name. How do we set up an Xpath for a filename that retrieves an
> attribute from this message:
>
> <?xml version="1.0" encoding="utf-8"?>
> <ns0:Order xmlns:ns0="http://site/schemas/PO">
> <ns0:PO>
> <ns0:poNo>1</ns0:poNo>
> <ns0:name>OrderName</ns0:name>
> </ns0:PO>
> </ns0:Order>
>
>
| |
|
| When setting the output file name using the FILE adapter, this is true.
However, the Sharepoint adapter does not support dynamic send ports and not
the %SourceFileName% macro. The only valid file name could either be a
string, the %GUID% macro, or an Xpath query using a field from the document
passed.
We have defined a static one-way send port using the WSSLib transport type
(Sharepoint adapter), and in the Address (URI) definition we have used these
values:
The File Name section contains:
Base: /*[local-name()='Order']/*[local-name()='PO']/*[local-name()='poNo']
Extension: xml
Namespace: http://site/schemas/PO
The Location section contains:
Overwrite? True
Site Address URL: http://servername
Site Folder Name: Shared Documents
These values results in the “Could not post document to SharePoint” error
message appearing in the event log, but we know for sure that root cause to
this failure is either an error in the Base or in the Namespace variables.
This probably means that the Xpath is not correct.
- JPS
"Neal Walters" wrote:
[vbcol=seagreen]
> There are two ways to set the output filename:
>
> 1) You can change the incoming filename:
> mProcessingReportIn(FILE.ReceivedFileName);
>
> Then on your send port use the macro %Source_File_Name%.
>
> 2) Use dynamic ports - set this property of the output port name:
>
> oprtTriggerBackSendFile(Microsoft.XLANGs.BaseTypes.Address) =
> @"file://" + vTriggerFileName;
>
> I don't quit understand your attribute question (there is no attribute in
> your XML other than the namespace itself), but you will probably have to ue
> the local-name parameter in your Xpath. See the blog at my site below.
>
> Neal Walters
> http://Biztalk-Training.com
>
>
> "JPS" wrote:
>
| |
|
| After some struggling, we found the answer:
Base:=//*[local-name()='Order']/*[local-name()='PO']/*[local-name()='poNo']
Extension: xml
Namespace: < leave empty >
Overwrite? True
Site Address URL: http://servername
Site Folder Name: Shared Documents
"JPS" wrote:
> When setting the output file name using the FILE adapter, this is true.
> However, the Sharepoint adapter does not support dynamic send ports and not
> the %SourceFileName% macro. The only valid file name could either be a
> string, the %GUID% macro, or an Xpath query using a field from the document
> passed.
>
> We have defined a static one-way send port using the WSSLib transport type
> (Sharepoint adapter), and in the Address (URI) definition we have used these
> values:
>
> The File Name section contains:
> Base: /*[local-name()='Order']/*[local-name()='PO']/*[local-name()='poNo']
> Extension: xml
> Namespace: http://site/schemas/PO
> The Location section contains:
> Overwrite? True
> Site Address URL: http://servername
> Site Folder Name: Shared Documents
>
> These values results in the “Could not post document to SharePoint” error
> message appearing in the event log, but we know for sure that root cause to
> this failure is either an error in the Base or in the Namespace variables.
> This probably means that the Xpath is not correct.
>
> - JPS
>
>
> "Neal Walters" wrote:
>
>
| |
| jaybts 2006-04-08, 3:08 am |
| Hi,
I am new to BTS, i am working on WSSLib adapter. My requirement is that i should name the document base on my customer number which is in my XML.
My XML looks like shown below
<Account xmlns:ns0="mscrm2gp_schemas.Debtor">
<msCRMID>msCRMID_0</msCRMID>
<CUSTNMBR>5050</CUSTNMBR>
<CUSTNAME>CUSTNAME_0</CUSTNAME>
<TAXSCHID>TAXSCHID_0</TAXSCHID>
<SHIPMTHD>SHIPMTHD_0</SHIPMTHD>
<ADDRESS1>ADDRESS1_0</ADDRESS1>
<CITY>CITY_0</CITY>
<STATE>STATE_0</STATE>
<ZIPCODE>ZIPCODE_0</ZIPCODE>
<COUNTRY>COUNTRY_0</COUNTRY>
<PHNUMBR1>PHNUMBR1_0</PHNUMBR1>
<PHNUMBR2>PHNUMBR2_0</PHNUMBR2>
<FAX>FAX_0</FAX>
<COMMENT1>COMMENT1_0</COMMENT1>
<COMMENT2>COMMENT2_0</COMMENT2>
<ADRSCODE>ADRSCODE_0</ADRSCODE>
<UpdateIfExists>UpdateIfExists_0</UpdateIfExists>
<STMTNAME>STMTNAME_0</STMTNAME>
<SHRTNAME>SHRTNAME_0</SHRTNAME>
<Revalue_Customer>Revalue_Customer_0</Revalue_Customer>
<Post_Results_To>Post_Results_To_0</Post_Results_To>
<AcceptedRejected>AcceptedRejected_0</AcceptedRejected>
<Finance_Status>8</Finance_Status>
<Source_System>CRM</Source_System>
<Destination_System>GP</Destination_System>
<Transmission_Entity>Account</Transmission_Entity>
<Changing_User>Changing_User_0</Changing_User>
<Changing_User_Email>Changing_User_Email_0</Changing_User_Email>
<TS_Status>false</TS_Status>
</Account>
Can you explain me in details what does
Order stands for, PO stands for & poNo stands for in
Base:=//*[local-name()='Order']/*[local-name()='PO']/*[local-nam
e()='poNo']
I should name my document with the value of <CUSTNMBR> tag.
Thaks.
quote: Originally posted by JPS
After some struggling, we found the answer:
Base:=//*[local-name()='Order']/*[local-name()='PO']/*[local-name()='poNo']
Extension: xml
Namespace: < leave empty >
Overwrite? True
Site Address URL: http://servername
Site Folder Name: Shared Documents
"JPS" wrote:
> When setting the output file name using the FILE adapter, this is true.
> However, the Sharepoint adapter does not support dynamic send ports and not
> the %SourceFileName% macro. The only valid file name could either be a
> string, the %GUID% macro, or an Xpath query using a field from the document
> passed.
>
> We have defined a static one-way send port using the WSSLib transport type
> (Sharepoint adapter), and in the Address (URI) definition we have used these
> values:
>
> The File Name section contains:
> Base: /*[local-name()='Order']/*[local-name()='PO']/*[local-name()='poNo']
> Extension: xml
> Namespace: http://site/schemas/PO
> The Location section contains:
> Overwrite? True
> Site Address URL: http://servername
> Site Folder Name: Shared Documents
>
> These values results in the “Could not post document to SharePoint” error
> message appearing in the event log, but we know for sure that root cause to
> this failure is either an error in the Base or in the Namespace variables.
> This probably means that the Xpath is not correct.
>
> - JPS
>
>
> "Neal Walters" wrote:
>
>
|
|
|
|
|