BizTalk BlobStorageAdapter - Promote Blob Metadata as BizTalk properties - azure-blob-storage

I'm using the AzureBlobStorage adapter in BizTalk 2020 and to receive blobs from Azure Blob Storage. The blobs have metadata which I want to use within my orchestration. So I created and deployed a schema containing the metadata keys as elements.
Within the receive location I entered the "Namespace for blob metadata" with the namespace of my schema and checked the checkbox "Promote metadata properties"
Unfortunately I'm getting the following error: "Loading property information by list by namespace failed or property not found in the list. Verify that the schema is deployed properly."
Schema:
<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://POC.Test.AzBlobMetadata.AzLaParameters" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" targetNamespace="http://POC.Test.AzBlobMetadata.AzLaParameters" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:annotation>
<xs:appinfo>
<b:schemaInfo schema_type="AzLaParameters" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" />
</xs:appinfo>
</xs:annotation>
<xs:element name="MetaData">
<xs:complexType>
<xs:sequence>
<xs:element name="la_name" type="xs:string" />
<xs:element name="la_runid" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Receive Location / Adapter configuration:

Related

In an Office add-in manifest, why must <Permissions> immediately follow <FormSettings/>?

This issue is best demonstrated by example. Consider the following:
In the first example, my <Permissions/> element is placed immediately after the <FormSettings/> block:
<?xml version="1.0" encoding="UTF-8"?>
<OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0" xmlns:mailappor="http://schemas.microsoft.com/office/mailappversionoverrides/1.0" xsi:type="MailApp">
<Id>464672b2-35a8-44a1-8c06-3ad07ed893a7</Id>
<Version>1.0.0.0</Version>
<ProviderName>Example</ProviderName>
<DefaultLocale>en-US</DefaultLocale>
<DisplayName DefaultValue="Example A"/>
<Description DefaultValue="This is an example add-in."/>
<IconUrl DefaultValue="https://placehold.it/64x64"/>
<HighResolutionIconUrl DefaultValue="https://placehold.it/64x64"/>
<SupportUrl DefaultValue="https://example.com/"/>
<Hosts>
<Host Name="Mailbox"/>
</Hosts>
<Requirements>
<Sets>
<Set Name="MailBox" MinVersion="1.1"/>
</Sets>
</Requirements>
<FormSettings>
<Form xsi:type="ItemEdit">
<DesktopSettings>
<SourceLocation DefaultValue="https://example.com"/>
</DesktopSettings>
</Form>
</FormSettings>
<Permissions>ReadWriteMailbox</Permissions>
<Rule xsi:type="RuleCollection" Mode="And">
<Rule xsi:type="ItemIs" ItemType="Message" FormType="Edit"/>
</Rule>
</OfficeApp>
I am able to successfully add this manifest to my Exchange Admin Center's organization add-ins list.
However, if I move the <Permissions/> element anywhere else in the manifest, the manifest fails validation when attempting to add it:
<?xml version="1.0" encoding="UTF-8"?>
<OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0" xmlns:mailappor="http://schemas.microsoft.com/office/mailappversionoverrides/1.0" xsi:type="MailApp">
<Id>464672b2-35a8-44a1-8c06-3ad07ed893a7</Id>
<Version>1.0.0.0</Version>
<ProviderName>Example</ProviderName>
<DefaultLocale>en-US</DefaultLocale>
<DisplayName DefaultValue="Example A"/>
<Description DefaultValue="This is an example add-in."/>
<IconUrl DefaultValue="https://placehold.it/64x64"/>
<HighResolutionIconUrl DefaultValue="https://placehold.it/64x64"/>
<SupportUrl DefaultValue="https://example.com/"/>
<Hosts>
<Host Name="Mailbox"/>
</Hosts>
<Requirements>
<Sets>
<Set Name="MailBox" MinVersion="1.1"/>
</Sets>
</Requirements>
<FormSettings>
<Form xsi:type="ItemEdit">
<DesktopSettings>
<SourceLocation DefaultValue="https://example.com"/>
</DesktopSettings>
</Form>
</FormSettings>
<Rule xsi:type="RuleCollection" Mode="And">
<Rule xsi:type="ItemIs" ItemType="Message" FormType="Edit"/>
</Rule>
<Permissions>ReadWriteMailbox</Permissions>
</OfficeApp>
Attempting to add this manifest to my Exchange Admin Center's organization add-ins list produces the following error:
This app can't be installed. The manifest file doesn't conform to the schema definition. The element 'OfficeApp' in namespace 'http://schemas.microsoft.com/office/appforoffice/1.1' has invalid child element 'Permissions' in namespace 'http://schemas.microsoft.com/office/appforoffice/1.1'. List of possible elements expected: 'DisableEntityHighlighting' in namespace 'http://schemas.microsoft.com/office/appforoffice/1.1' as well as 'VersionOverrides' in namespace 'http://schemas.microsoft.com/office/mailappversionoverrides' as well as any element in namespace 'http://www.w3.org/2000/09/xmldsig#'...
It is only through trial and error were we able to find the root cause of this validation failure.
My question: Why does ordering matter? Why can the <Permissions/> element not appear anywhere within the same nesting level in the manifest?
Context
This validation failure occurs in hosted Exchange (Office 365), and also when attempting to submit an add-in to the Office Store, at the step where a manifest is requested.
Why does ordering matter?
Order of the tags defined by schema file. In your case you have included in the manifest http://schemas.microsoft.com/office/appforoffice/1.1 Schema. Try to find in the schema <Permissions/> element and you will see the following definition ...
<xs:complexType name="MailApp">
<xs:complexContent>
<xs:extension base="OfficeApp">
<xs:sequence>
<xs:element name="Requirements" type="MailAppRequirements" minOccurs="1" maxOccurs="1"/>
<xs:element name="FormSettings" type="FormSettings" minOccurs="1" maxOccurs="1"/>
<xs:element name="Permissions" minOccurs="0" maxOccurs="1" type="ST_Permissions2"/>
<xs:element name="Rule" type="Rule" minOccurs="1" maxOccurs="1"/>
<xs:element name="DisableEntityHighlighting" type="xs:boolean" minOccurs="0" maxOccurs="1"/>
<xs:element ref="mailor:VersionOverrides" minOccurs="0" maxOccurs="1"/>
<xs:any id="MailAppSignature" minOccurs="0" maxOccurs="1" namespace="http://www.w3.org/2000/09/xmldsig#" processContents="lax"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
Element <Permissions/> is in the <sequence/> which means it must be in order defined by this element and it's right after <FormSettings/> and nowhere elese.
Order of the tags defined by schema file. Unfortunately this is not well documented and we are working to improve this documentation. Order matters when defining a manifest for Outlook web add-ins because of the way we validate the schema for installation. We realize this can be a hassle especially since it's not well documented but the main reason we require a specific order is because it allows us to validate the manifest content quickly and increase performance of the service.
Thank you for providing this feedback on our documentation.

JAXB Compilation issue -'ArrayOfstring' is already defined

I'm getting this error when I run "mvn clean install"
Thrown by JAXB:
[ERROR] Thrown by JAXB: 'ArrayOfstring' is already defined
[ERROR]
[ERROR] Thrown by JAXB: (related to above error) the first definition appears here
[ERROR]
[ERROR] Thrown by JAXB: 'ArrayOfstring' is already defined
ArrayOfString appears multiple times in multiple XSD files using the same namespace.
wsdl0:
<xsd:schema elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<xsd:complexType name="ArrayOfstring">
<xsd:sequence>
<xsd:element minOccurs="0" maxOccurs="unbounded" name="string" nillable="true" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="ArrayOfstring" nillable="true" type="tns:ArrayOfstring"/>
</xsd:schema>
wsdl1:
<xsd:schema elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<xsd:complexType name="ArrayOfstring">
<xsd:sequence>
<xsd:element minOccurs="0" maxOccurs="unbounded" name="string" nillable="true" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="ArrayOfstring" nillable="true" type="tns:ArrayOfstring"/>
</xsd:schema>
</wsdl:types>
How would I resolve this? I'm assuming I would have to use an external bindings file...Thanks!
Sam
I would generate for each wsdl the classes in a different package and then you will not have any clashes. This can be achieved using binding files:
https://github.com/highsource/maven-jaxb2-plugin/wiki/Configure-Target-Packages-in-Binding-Files as you assumed.

Setting JDBCLoginTimeoutSeconds on the ServerMBean for Weblogic

How to set up jdbc-login-timeout-seconds before I start the server. On Weblogic server startup, if a database is unreachable for a data source, Weblogic Server threads hang inside the JDBC driver code waiting for a reply from the database server.
The schema domain xmlns="http://xmlns.oracle.com/weblogic/domain" has this attribute jdbc-login-timeout-seconds but I am unable to figure out how to set this? Below is the details from domain.xsd
<xs:complexType name="serverType">
<xs:complexContent>
<xs:extension base="dom:kernelType">
<xs:element default="0" minOccurs="0" name="jdbc-login-timeout-seconds" nillable="false">
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="kernelType">
Below are the documentation for setting this up from oracle
1) http://docs.oracle.com/cd/E11035_01/wls100/schemaref/config/http.www.bea.com.ns.weblogic.920.domain/types/servertype.jdbc-login-timeout-seconds.html
2) http://docs.oracle.com/cd/E15523_01/web.1111/e13737/jdbc_datasources.htm#i1203054
Also if this can be done my setting JDBCLoginTimeoutSeconds attribute on the ServerMBean, please share the steps to set it up through admin console.
Below is my config.xml
<?xml version='1.0' encoding='UTF-8'?>
<domain xmlns="http://xmlns.oracle.com/weblogic/domain" xmlns:sec="http://xmlns.oracle.com/weblogic/security" xmlns:wls="http://xmlns.oracle.com/weblogic/security/wls" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/weblogic/security/xacml http://xmlns.oracle.com/weblogic/security/xacml/1.0/xacml.xsd http://xmlns.oracle.com/weblogic/security/providers/passwordvalidator http://xmlns.oracle.com/weblogic/security/providers/passwordvalidator/1.0/passwordvalidator.xsd http://xmlns.oracle.com/weblogic/domain http://xmlns.oracle.com/weblogic/1.0/domain.xsd http://xmlns.oracle.com/weblogic/security http://xmlns.oracle.com/weblogic/1.0/security.xsd http://xmlns.oracle.com/weblogic/security/wls http://xmlns.oracle.com/weblogic/security/wls/1.0/wls.xsd">
<name>base_domain</name>
<domain-version>10.3.5.0</domain-version>
<security-configuration>
<name>base_domain</name>
<realm>
<sec:authentication-provider xsi:type="wls:default-authenticatorType"></sec:authentication-provider>
<sec:authentication-provider xsi:type="wls:default-identity-asserterType">
<sec:active-type>AuthenticatedUser</sec:active-type>
</sec:authentication-provider>
<sec:role-mapper xmlns:xac="http://xmlns.oracle.com/weblogic/security/xacml" xsi:type="xac:xacml-role-mapperType"></sec:role-mapper>
<sec:authorizer xmlns:xac="http://xmlns.oracle.com/weblogic/security/xacml" xsi:type="xac:xacml-authorizerType"></sec:authorizer>
<sec:adjudicator xsi:type="wls:default-adjudicatorType"></sec:adjudicator>
<sec:credential-mapper xsi:type="wls:default-credential-mapperType"></sec:credential-mapper>
<sec:cert-path-provider xsi:type="wls:web-logic-cert-path-providerType"></sec:cert-path-provider>
<sec:cert-path-builder>WebLogicCertPathProvider</sec:cert-path-builder>
<sec:name>myrealm</sec:name>
<sec:password-validator xmlns:pas="http://xmlns.oracle.com/weblogic/security/providers/passwordvalidator" xsi:type="pas:system-password-validatorType">
<sec:name>SystemPasswordValidator</sec:name>
<pas:min-password-length>8</pas:min-password-length>
<pas:min-numeric-or-special-characters>1</pas:min-numeric-or-special-characters>
</sec:password-validator>
</realm>
<default-realm>myrealm</default-realm>
<credential-encrypted>{AES}QEVyKcPXSLI3fJ4+E7+vZXSCAyCiqKRCgZ+g3VG/6bg0+5W2aeZ/RvvdpY09+wFqyjSSENtW7uuPii8I5VcdAx6fXTLp5LabMTmVMKWU5ionHtVOvCbDCYHebmPnC6ky</credential-encrypted>
<node-manager-username>weblogic</node-manager-username>
<node-manager-password-encrypted>{AES}RFTA5Jc8EDK/SQOKxSJLcyEwWprM6bmtefX4yPgaNjs=</node-manager-password-encrypted>
</security-configuration>
<server>
<name>AdminServer</name>
<listen-address></listen-address>
</server>
<embedded-ldap>
<name>base_domain</name>
<credential-encrypted>{AES}WFD4gnix1Q8sUzcFWhXtZf/bWE2C4qu7lokJGxmRn23fwSi1o8EzZx0TW9QqxnVm</credential-encrypted>
</embedded-ldap>
<configuration-version>10.3.5.0</configuration-version>
<admin-server-name>AdminServer</admin-server-name>
<jdbc-system-resource>
<name>appDS</name>
<target>AdminServer</target>
<descriptor-file-name>jdbc/appDS-jdbc.xml</descriptor-file-name>
</jdbc-system-resource>
</domain>
1) Open a command prompt
2) Go to: domain-name/bin
3) Run:
. ./setDomainEnv.sh
java weblogicWLST
4) Once WLST is started, execute the following commands:
prompt>connect('username','password','t3://ip:port')
prompt>edit()
prompt>startEdit()
prompt>cd('Servers/server-name')
prompt>ls()
NOTE: this will list all the MBeans available. Please make sure "JDBCLoginTimeoutSeconds" is there
prompt>cmo.setJDBCLoginTimeoutSeconds(10)
prompt>save()
prompt>activate()
5) Restart the server

Why am I getting different validation between an XSD regex with Nokogiri and normal Ruby regular expressions?

I have an XSD schema that includes a rule for a specific field to match the following regex:
\d{8}[\-]?[A-Za-z]{0,3}
Using irb, I can test with this regex and the following strings all match, which is correct:
12345678
12345678-
12345678-abc
12345678abc
When I attempt to validate some XML against this XSD, I get slightly different behaviour:
Passes:
12345678-
12345678-abc
12345678abc
Fails:
12345678
And here is a mimimal XSD/XML files that reproduces this:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:simpleType name="codeType">
<xs:restriction base="xs:token">
<xs:pattern value="\d{8}[\-]?[A-Za-z]{0,3}"/>
</xs:restriction>
</xs:simpleType>
<xs:element name="test">
<xs:complexType>
<xs:sequence>
<xs:element type="codeType" name="code"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
And XML:
<?xml version="1.0" encoding="UTF-8"?>
<test>
<code>11034755</code>
</test>
And running this with
xmllint --schema test.xsd test.xml
Gives
Element 'code': [facet 'pattern'] The value '11034755' is not accepted by the pattern '\d{8}[\-]?[A-Za-z]{0,3}'
While XML schema does not have full regular expressions, this should be valid I think. What am I not understanding when it comes to regular expressions in XSD files in this particular case with regards to '?' ?
Using Rubular to test /\d{8}-?(?:[a-zA-Z]{3})?/ I get hits for all strings.
Alternately /\d{8}[a-zA-Z-]*/, /\d{8}[a-z-]*/i, and /\d{8}[a-z-]{0,4}/i work also.
You can use {0,3} or {,3} so those might help.

c# XDocument Xsd pattern validation with character $

I have a problem with c# XDocument XSD validation.
The following file is validated well by Xml Spy, but not by .Net (c#)
<Root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Simple.xsd">
<Var Name="$Toto"/>
</Root>
Schema
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="Root">
<xs:complexType>
<xs:sequence>
<xs:element name="Var">
<xs:complexType>
<xs:attribute name="Name" type="ST_VariableIdentifier" use="required"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:simpleType name="ST_VariableIdentifier">
<xs:restriction base="xs:string">
<xs:pattern value="$[a-z,A-Z]*"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>
An idea?
This should work!
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="Root">
<xs:complexType>
<xs:sequence>
<xs:element name="Var">
<xs:complexType>
<xs:attribute name="Name" type="ST_VariableIdentifier" use="required"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:simpleType name="ST_VariableIdentifier">
<xs:restriction base="xs:string">
<xs:pattern value="[$][a-z,A-Z]*"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>
Just to add to the existing answer. This is actually a known 'bug' in the .Net implementation of the W3C specs (acknowledged here on Connect, but Won't fix).
MSDN provides more information (here), together with the workaround mentioned above.
The System.Xml implementation of the World Wide Web Consortium (W3C)
Recommendations for XML Schemas uses the RegEx class to perform
pattern matching of regular expressions. In some cases, the behavior
recommended by W3C differs from the RegEx class behavior. The
following are the known cases where the System.Xml implementation of
pattern matching differs from the W3C specification:
According to the W3C for XML Schema specification, the dollar sign ($)
should be treated as a regular character. However, the System.Xml
validation interprets a dollar sign in the xs:pattern as an
end-of-line anchor. The possible workaround is to replace $ with [$].
If your pattern is already in brackets, such as [abc$], it is not
necessary to make any changes.

Resources