WS Federation Validate Throws Missing Configuration Exception with provided MetadataAddress - .net-6.0

im struggling with the Configuration of a WsFederation Authentication, and i dont know whats missing here, because what it asks for is clearly provided.
Maybe somebody has an idea what could be the problem.
But Lets dive in some code, first we start with the AddWsFederation Configuration:
builder.AddWsFederation($"{scheme}:fed", "WS Federation Connect", options =>
{
options.ClaimsIssuer = "https://internal.identity.provider";
options.Wtrealm = "https://localhost:5001/";
options.Wreply = "https://localhost:5001/";
options.MetadataAddress = "https://internal.identity.provider/v2/FederationMetadata/2007-06/FederationMetadata.xml";
options.RequireHttpsMetadata = true;
options.CallbackPath = "/signin-wsf-fe";
options.Validate();
});
As you can see i provide a MetadataAddress, but the options.Validate() code thows still the following exception:
Provide MetadataAddress, Configuration, or ConfigurationManager to WsFederationOptions
Im not very expirenced with this type of authentication, so im pretty much at a loss.
In case someone wants to see the structure of the FederationMetadata.xml
<EntityDescriptor ID="<<some id>>" entityID="http://internal.identity.provider/" xmlns="urn:oasis:names:tc:SAML:2.0:metadata">
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignedInfo>
<CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
<SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256" />
<Reference URI="#_3fa19ded-fa24-4d70-9f80-6255e9f860e4">
<Transforms>
<Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
<Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" />
<DigestValue>some-value</DigestValue>
</Reference>
</SignedInfo>
<SignatureValue>some signature value</SignatureValue>
<KeyInfo>
<X509Data>
<X509Certificate>some certificate </X509Certificate>
</X509Data>
</KeyInfo>
</Signature>
<RoleDescriptor xsi:type="fed:SecurityTokenServiceType"
protocolSupportEnumeration="http://docs.oasis-open.org/wsfed/federation/200706"
ServiceDescription="my Identity"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:fed="http://docs.oasis-open.org/wsfed/federation/200706">
<KeyDescriptor use="signing">
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<X509Data>
<X509Certificate>some value</X509Certificate>
</X509Data>
</KeyInfo>
</KeyDescriptor>
<fed:TokenTypesOffered><fed:TokenType Uri="http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1" />
<fed:TokenType Uri="http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0" />
</fed:TokenTypesOffered>
<fed:ClaimTypesOffered>
<auth:ClaimType Uri="http://schemas.microsoft.com/ws/2008/06/identity/claims/role" xmlns:auth="http://docs.oasis-open.org/wsfed/authorization/200706" />
<auth:ClaimType Uri="http://internal.identity.provider/claims/contactid" xmlns:auth="http://docs.oasis-open.org/wsfed/authorization/200706" />
<auth:ClaimType Uri="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress" xmlns:auth="http://docs.oasis-open.org/wsfed/authorization/200706" />
<auth:ClaimType Uri="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn" xmlns:auth="http://docs.oasis-open.org/wsfed/authorization/200706" />
</fed:ClaimTypesOffered>
<fed:SecurityTokenServiceEndpoint>
<wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:Address>https://internal.identity.provider/v2/issue/wstrust/mixed/username</wsa:Address>
</wsa:EndpointReference>
</fed:SecurityTokenServiceEndpoint>
<fed:SecurityTokenServiceEndpoint>
<wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:Address>https://internal.identity.provider/v2/issue/wstrust/mixed/certificate</wsa:Address>
</wsa:EndpointReference>
</fed:SecurityTokenServiceEndpoint>
<fed:PassiveRequestorEndpoint>
<wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:Address>https://internal.identity.provider/v2/issue/hrd</wsa:Address>
</wsa:EndpointReference>
</fed:PassiveRequestorEndpoint>
</RoleDescriptor>
<RoleDescriptor xsi:type="fed:ApplicationServiceType"
protocolSupportEnumeration="http://docs.oasis-open.org/wsfed/federation/200706"
ServiceDescription="my Identity"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:fed="http://docs.oasis-open.org/wsfed/federation/200706">
<KeyDescriptor use="signing">
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<X509Data>
<X509Certificate>some value</X509Certificate>
</X509Data>
</KeyInfo>
</KeyDescriptor>
<fed:TokenTypesOffered>
<fed:TokenType Uri="http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1" />
<fed:TokenType Uri="http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0" />
</fed:TokenTypesOffered>
<fed:ClaimTypesOffered>
<auth:ClaimType Uri="http://schemas.microsoft.com/ws/2008/06/identity/claims/role" xmlns:auth="http://docs.oasis-open.org/wsfed/authorization/200706" />
<auth:ClaimType Uri="http://internal.identity.provider/claims/contactid" xmlns:auth="http://docs.oasis-open.org/wsfed/authorization/200706" />
<auth:ClaimType Uri="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress" xmlns:auth="http://docs.oasis-open.org/wsfed/authorization/200706" />
<auth:ClaimType Uri="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn" xmlns:auth="http://docs.oasis-open.org/wsfed/authorization/200706" />
</fed:ClaimTypesOffered>
<fed:PassiveRequestorEndpoint>
<wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:Address>https://internal.identity.provider/v2/issue/hrd</wsa:Address>
</wsa:EndpointReference>
</fed:PassiveRequestorEndpoint>
</RoleDescriptor>
</EntityDescriptor>
In case someone has an idea what i am missing here, feel free to leave a comment, or even en answer would be much apricated.
Best Regards and Thanks in Advance

Related

Making Office 365 addin manifests that actually work when deployed

We are a Microsoft partner (although we've never had any value derived from it). We have desktop office VSTO addins for classifying documents that we sell to governments but moved to online given their 365 cloud push. The manifest generation process is very irritating. Manifests that previously worked stop working arbitrarily. We've found the office 365 addin development process disappointing to be frank. Dealing with this stack is like a black hole of apathy and malaise. It reminds me of trying to compile my C program on a server back in 2000 and getting arcane errors and not knowing what went wrong. If I was in charge I would advise our management to drop this stack and find something else to sell, because it's just not worth the headache. We're bleeding money with multiple devs and QA trying to figure out why a blob of xml isn't working.
We looked at the yeoman generator's output and tried to compare it to our own, but didn't see much difference. We keep getting random 1300X errors (that change depending on which tenant we're on). After looking at the code here https://github.com/OfficeDev/Office-Addin-Scripts I can't help but laugh at your folly. You wrongly chose configuration (the manifest) over code. Then you made a bunch of hand-coded xml handling instead of creating a general XSD-based schema editing tool (which apparently previously existed but now does not).
That said. I get that you're exporting your internal concerns onto platform users, but I need to sell software and I can't do that when I can't get our addin deployed so we can test it. Manifests work when inserted manually for debug, but not when deployed. What gives?
Can anybody tell me what's wrong with this outlook manifest? Why don't it deploy?
edit in response to comments:
Please bear with me as I gather info from our IT people as I posted this on their behalf because they were frustrated but were also hesitant to post here due to previous bad experiences etc. The manifest had many issues. The errors were different for word vs outlook. Sometimes we would get validation errors with no information (even though the addin passed the validation tool). Other times it threw 13004 (if I remember correctly). I suspect the validation tools don't fully do URL checking until deployment. A missing help URL threw us as well. I will take the latest manifests we have and diff them with the sample i provided and compare that to the answer below. It appears as though they eventually got it working after a lot of trial and error...
<OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0" xmlns:mailappor="http://schemas.microsoft.com/office/mailappversionoverrides/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="MailApp">
<Id>22222222-1111-1111-1111-11111111ABCD</Id>
<Version>1.0.0.0</Version>
<ProviderName>Banana</ProviderName>
<DefaultLocale>en-US</DefaultLocale>
<DisplayName DefaultValue="Banana Classifier">
<Override Locale="fr-CA" Value="Classifieur Banana" />
<Override Locale="fr-FR" Value="Classifieur Banana" />
</DisplayName>
<Description DefaultValue="Fruit Banana Classifier">
<Override Locale="fr-CA" Value="Classifieur Banana de Fruit" />
<Override Locale="fr-FR" Value="Classifieur Banana de Fruit" />
</Description>
<IconUrl DefaultValue="https://localhost:3000/assets/Banana_32.png" />
<HighResolutionIconUrl DefaultValue="https://localhost:3000/assets/Banana_80.png" />
<SupportUrl DefaultValue="https://www.Fruitsolutions.com/" />
<AppDomains>
<AppDomain>https://login.microsoftonline.com/</AppDomain>
<AppDomain>https://localhost:3000/</AppDomain>
<AppDomain>https://www.Fruitsolutions.com/</AppDomain>
</AppDomains>
<Hosts>
<Host Name="Mailbox" />
</Hosts>
<Requirements>
<Sets>
<Set Name="Mailbox" MinVersion="1.1" />
</Sets>
</Requirements>
<FormSettings>
<Form xsi:type="ItemRead">
<DesktopSettings>
<SourceLocation DefaultValue="https://localhost:3000/index.html" />
<RequestedHeight>450</RequestedHeight>
</DesktopSettings>
</Form>
<Form xsi:type="ItemEdit">
<DesktopSettings>
<SourceLocation DefaultValue="https://localhost:3000/index.html" />
</DesktopSettings>
</Form>
</FormSettings>
<Permissions>ReadWriteMailbox</Permissions>
<Rule xsi:type="RuleCollection" Mode="Or">
<Rule xsi:type="ItemIs" ItemType="Message" FormType="Edit" />
<Rule xsi:type="ItemIs" ItemType="Message" FormType="Read" />
</Rule>
<DisableEntityHighlighting>false</DisableEntityHighlighting>
<VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides" xsi:type="VersionOverridesV1_0">
<VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides/1.1" xsi:type="VersionOverridesV1_1">
<Requirements>
<bt:Sets DefaultMinVersion="1.3">
<bt:Set Name="Mailbox" />
</bt:Sets>
</Requirements>
<Hosts>
<Host xsi:type="MailHost">
<DesktopFormFactor>
<FunctionFile resid="Fruit.DesktopFunctionFile.Url" />
<ExtensionPoint xsi:type="CustomPane">
<RequestedHeight>450</RequestedHeight>
<SourceLocation resid="Fruit.Taskpane.Url" />
<Rule xsi:type="RuleCollection" Mode="Or">
<Rule xsi:type="ItemIs" ItemType="Message" />
</Rule>
</ExtensionPoint>
<ExtensionPoint xsi:type="MessageReadCommandSurface">
<OfficeTab id="TabDefault">
<Group id="msgReadGroup">
<Label resid="Fruit.Group1Label" />
<Control xsi:type="Button" id="msgReadOpenPaneButton">
<Label resid="Fruit.TaskpaneButton.Label" />
<Supertip>
<Title resid="Fruit.TaskpaneButton.Label" />
<Description resid="Fruit.TaskpaneButton.Tooltip" />
</Supertip>
<Icon>
<bt:Image size="16" resid="Fruit.tpicon_16x16" />
<bt:Image size="32" resid="Fruit.tpicon_32x32" />
<bt:Image size="80" resid="Fruit.tpicon_80x80" />
</Icon>
<Action xsi:type="ShowTaskpane">
<SourceLocation resid="Fruit.Taskpane.Url" />
</Action>
</Control>
</Group>
</OfficeTab>
</ExtensionPoint>
</DesktopFormFactor>
</Host>
</Hosts>
<Resources>
<bt:Images>
<bt:Image id="Fruit.tpicon_16x16" DefaultValue="https://localhost:3000/assets/Banana_16.png" />
<bt:Image id="Fruit.tpicon_32x32" DefaultValue="https://localhost:3000/assets/Banana_32.png" />
<bt:Image id="Fruit.tpicon_80x80" DefaultValue="https://localhost:3000/assets/Banana_80.png" />
</bt:Images>
<bt:Urls>
<bt:Url id="Fruit.Taskpane.Url" DefaultValue="https://localhost:3000/index.html" />
<bt:Url id="Fruit.GetStarted.LearnMoreUrl" DefaultValue="https://www.Fruitsolutions.com/" />
<bt:Url id="Fruit.DesktopFunctionFile.Url" DefaultValue="https://localhost:3000/function-file/function-file.html" />
</bt:Urls>
<bt:ShortStrings>
<bt:String id="Fruit.TaskpaneButton.Label" DefaultValue="Banana Classifier">
<bt:Override Locale="fr-CA" Value="Classifieur Banana" />
<bt:Override Locale="fr-FR" Value="Classifieur Banana" />
</bt:String>
<bt:String id="Fruit.Group1Label" DefaultValue="Fruit">
<bt:Override Locale="fr-CA" Value="Fruit" />
<bt:Override Locale="fr-FR" Value="Fruit" />
</bt:String>
<bt:String id="Fruit.GetStarted.Title" DefaultValue="Fruit Banana Classifier">
<bt:Override Locale="fr-CA" Value="Classifieur Banana de Fruit" />
<bt:Override Locale="fr-FR" Value="Classifieur Banana de Fruit" />
</bt:String>
</bt:ShortStrings>
<bt:LongStrings>
<bt:String id="Fruit.TaskpaneButton.Tooltip" DefaultValue="Click to Show the Fruit Banana Classifier">
<bt:Override Locale="fr-CA" Value="Cliquer pour afficher le Classifieur Banana" />
<bt:Override Locale="fr-FR" Value="Cliquer pour afficher le Classifieur Banana" />
</bt:String>
<bt:String id="Fruit.GetStarted.Description" DefaultValue="The Fruit Banana Classifier Add-in loaded successfully. Click the 'Banana Classifier' button to get started.">
<bt:Override Locale="fr-CA" Value="Le complément Classifieur Banana a été chargé avec succès. Veuillez cliquer sur le bouton 'Classifieur Banana' pour débuter." />
<bt:Override Locale="fr-FR" Value="Le complément Classifieur Banana a été chargé avec succès. Veuillez cliquer sur le bouton 'Classifieur Banana' pour débuter." />
</bt:String>
</bt:LongStrings>
</Resources>
<WebApplicationInfo>
<Id>22222222-1111-1111-1111-11111111ABCD</Id>
<Resource>api://localhost:3000/Banana_CLASSIFIER_AZURE_APPLICATION_ID</Resource>
<Scopes>
<Scope>Files.ReadWrite.All</Scope>
<Scope>Mail.Read</Scope>
<Scope>Mail.ReadWrite</Scope>
<Scope>Mail.ReadWrite.Shared</Scope>
<Scope>offline_access</Scope>
<Scope>openid</Scope>
<Scope>profile</Scope>
<Scope>Sites.ReadWrite.All</Scope>
<Scope>User.Read</Scope>
</Scopes>
</WebApplicationInfo>
</VersionOverrides>
</VersionOverrides>
</OfficeApp>
I installed your manifest above to an exchange account, and it reported the id was invalid, and that the resources needed to be under your base url (fruitsolutions). I corrected those (with dummy values), and then it uploaded to the account, and loaded the button to Outlook.
<OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0" xmlns:mailappor="http://schemas.microsoft.com/office/mailappversionoverrides/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="MailApp">
<Id>22222222-1111-1111-1111-11111111ABCD</Id>
<Version>1.0.0.0</Version>
<ProviderName>Banana</ProviderName>
<DefaultLocale>en-US</DefaultLocale>
<DisplayName DefaultValue="Banana Classifier">
<Override Locale="fr-CA" Value="Classifieur Banana" />
<Override Locale="fr-FR" Value="Classifieur Banana" />
</DisplayName>
<Description DefaultValue="Fruit Banana Classifier">
<Override Locale="fr-CA" Value="Classifieur Banana de Fruit" />
<Override Locale="fr-FR" Value="Classifieur Banana de Fruit" />
</Description>
<IconUrl DefaultValue="https://localhost:3000/assets/Banana_32.png" />
<HighResolutionIconUrl DefaultValue="https://localhost:3000/assets/Banana_80.png" />
<SupportUrl DefaultValue="https://www.Fruitsolutions.com/" />
<AppDomains>
<AppDomain>https://login.microsoftonline.com/</AppDomain>
<AppDomain>https://localhost:3000/</AppDomain>
<AppDomain>https://www.Fruitsolutions.com/</AppDomain>
</AppDomains>
<Hosts>
<Host Name="Mailbox" />
</Hosts>
<Requirements>
<Sets>
<Set Name="Mailbox" MinVersion="1.1" />
</Sets>
</Requirements>
<FormSettings>
<Form xsi:type="ItemRead">
<DesktopSettings>
<SourceLocation DefaultValue="https://localhost:3000/index.html" />
<RequestedHeight>450</RequestedHeight>
</DesktopSettings>
</Form>
<Form xsi:type="ItemEdit">
<DesktopSettings>
<SourceLocation DefaultValue="https://localhost:3000/index.html" />
</DesktopSettings>
</Form>
</FormSettings>
<Permissions>ReadWriteMailbox</Permissions>
<Rule xsi:type="RuleCollection" Mode="Or">
<Rule xsi:type="ItemIs" ItemType="Message" FormType="Edit" />
<Rule xsi:type="ItemIs" ItemType="Message" FormType="Read" />
</Rule>
<DisableEntityHighlighting>false</DisableEntityHighlighting>
<VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides" xsi:type="VersionOverridesV1_0">
<VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides/1.1" xsi:type="VersionOverridesV1_1">
<Requirements>
<bt:Sets DefaultMinVersion="1.3">
<bt:Set Name="Mailbox" />
</bt:Sets>
</Requirements>
<Hosts>
<Host xsi:type="MailHost">
<DesktopFormFactor>
<FunctionFile resid="Fruit.DesktopFunctionFile.Url" />
<ExtensionPoint xsi:type="CustomPane">
<RequestedHeight>450</RequestedHeight>
<SourceLocation resid="Fruit.Taskpane.Url" />
<Rule xsi:type="RuleCollection" Mode="Or">
<Rule xsi:type="ItemIs" ItemType="Message" />
</Rule>
</ExtensionPoint>
<ExtensionPoint xsi:type="MessageReadCommandSurface">
<OfficeTab id="TabDefault">
<Group id="msgReadGroup">
<Label resid="Fruit.Group1Label" />
<Control xsi:type="Button" id="msgReadOpenPaneButton">
<Label resid="Fruit.TaskpaneButton.Label" />
<Supertip>
<Title resid="Fruit.TaskpaneButton.Label" />
<Description resid="Fruit.TaskpaneButton.Tooltip" />
</Supertip>
<Icon>
<bt:Image size="16" resid="Fruit.tpicon_16x16" />
<bt:Image size="32" resid="Fruit.tpicon_32x32" />
<bt:Image size="80" resid="Fruit.tpicon_80x80" />
</Icon>
<Action xsi:type="ShowTaskpane">
<SourceLocation resid="Fruit.Taskpane.Url" />
</Action>
</Control>
</Group>
</OfficeTab>
</ExtensionPoint>
</DesktopFormFactor>
</Host>
</Hosts>
<Resources>
<bt:Images>
<bt:Image id="Fruit.tpicon_16x16" DefaultValue="https://www.Fruitsolutions.com/assets/Banana_16.png" />
<bt:Image id="Fruit.tpicon_32x32" DefaultValue="https://www.Fruitsolutions.com/assets/Banana_32.png" />
<bt:Image id="Fruit.tpicon_80x80" DefaultValue="https://www.Fruitsolutions.com/assets/Banana_80.png" />
</bt:Images>
<bt:Urls>
<bt:Url id="Fruit.Taskpane.Url" DefaultValue="https://www.Fruitsolutions.com/index.html" />
<bt:Url id="Fruit.GetStarted.LearnMoreUrl" DefaultValue="https://www.Fruitsolutions.com/" />
<bt:Url id="Fruit.DesktopFunctionFile.Url" DefaultValue="https://www.Fruitsolutions.com/function-file/function-file.html" />
</bt:Urls>
<bt:ShortStrings>
<bt:String id="Fruit.TaskpaneButton.Label" DefaultValue="Banana Classifier">
<bt:Override Locale="fr-CA" Value="Classifieur Banana" />
<bt:Override Locale="fr-FR" Value="Classifieur Banana" />
</bt:String>
<bt:String id="Fruit.Group1Label" DefaultValue="Fruit">
<bt:Override Locale="fr-CA" Value="Fruit" />
<bt:Override Locale="fr-FR" Value="Fruit" />
</bt:String>
<bt:String id="Fruit.GetStarted.Title" DefaultValue="Fruit Banana Classifier">
<bt:Override Locale="fr-CA" Value="Classifieur Banana de Fruit" />
<bt:Override Locale="fr-FR" Value="Classifieur Banana de Fruit" />
</bt:String>
</bt:ShortStrings>
<bt:LongStrings>
<bt:String id="Fruit.TaskpaneButton.Tooltip" DefaultValue="Click to Show the Fruit Banana Classifier">
<bt:Override Locale="fr-CA" Value="Cliquer pour afficher le Classifieur Banana" />
<bt:Override Locale="fr-FR" Value="Cliquer pour afficher le Classifieur Banana" />
</bt:String>
<bt:String id="Fruit.GetStarted.Description" DefaultValue="The Fruit Banana Classifier Add-in loaded successfully. Click the 'Banana Classifier' button to get started.">
<bt:Override Locale="fr-CA" Value="Le complément Classifieur Banana a été chargé avec succès. Veuillez cliquer sur le bouton 'Classifieur Banana' pour débuter." />
<bt:Override Locale="fr-FR" Value="Le complément Classifieur Banana a été chargé avec succès. Veuillez cliquer sur le bouton 'Classifieur Banana' pour débuter." />
</bt:String>
</bt:LongStrings>
</Resources>
<WebApplicationInfo>
<Id>22222222-1111-1111-1111-11111111ABCD</Id>
<Resource>https://www.Fruitsolutions.com/Banana_CLASSIFIER_AZURE_APPLICATION_ID</Resource>
<Scopes>
<Scope>Files.ReadWrite.All</Scope>
<Scope>Mail.Read</Scope>
<Scope>Mail.ReadWrite</Scope>
<Scope>Mail.ReadWrite.Shared</Scope>
<Scope>offline_access</Scope>
<Scope>openid</Scope>
<Scope>profile</Scope>
<Scope>Sites.ReadWrite.All</Scope>
<Scope>User.Read</Scope>
</Scopes>
</WebApplicationInfo>
</VersionOverrides>
</VersionOverrides>
</OfficeApp>

Passing a bearer token in a 'Web Test' without Visual Studio?

I want to import a ".webtest" in Azure's Application Insights availability feature. I dont have a test edition of Visual Studio, but this MSDN article suggests using Fiddler as another option to creating web tests.
I need to perform 2 requests on a REST API:
Request a bearer token from the connect/token endpoint.
Perform a GET at api/resources with the bearer token (retrieved from the above request) in the header.
It's a typical client credentials OAuth 2 flow.
I cannot seem to figure out how to do this with Fiddler. Basically I need to extract a value from the response body of request 1 and use it as the header value in request 2.
This is what the web test looks like without passing the token:
<?xml version="1.0" encoding="utf-8"?>
<TestCase Name="FiddlerGeneratedWebTest" Id="" Owner="" Description="" Priority="0" Enabled="True" CssProjectStructure="" CssIteration="" DeploymentItemsEditable="" CredentialUserName="" CredentialPassword="" PreAuthenticate="True" Proxy="" RequestCallbackClass="" TestCaseCallbackClass="">
<Items>
<Request Method="POST" Version="1.1" Url="https://example.com/connect/token" ThinkTime="8" Timeout="60" ParseDependentRequests="True" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8">
<Headers>
<Header Name="Content-Type" Value="application/x-www-form-urlencoded" />
</Headers>
<FormPostHttpBody ContentType="application/x-www-form-urlencoded">
<FormPostParameter Name="client_id" Value="myclientid" UrlEncode="True" />
<FormPostParameter Name="client_secret" Value="password123" UrlEncode="True" />
<FormPostParameter Name="grant_type" Value="client_credentials" UrlEncode="True" />
<FormPostParameter Name="scope" Value="myscopes" UrlEncode="True" />
</FormPostHttpBody>
</Request>
<Request Method="GET" Version="1.1" Url="https://example.com/api/resources" ThinkTime="0" Timeout="60" ParseDependentRequests="True" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8">
<Headers>
<Header Name="Authorization" Value="Bearer {{token}}" />
</Headers>
</Request>
</Items>
</TestCase>
Assuming this comes back as the following example you can use a regex extraction to get it.
{"token_type":"Bearer","scope":"user_impersonation","expires_in":"3600 ... "access_token":"{{TOKEN}}", ...}
<?xml version="1.0" encoding="utf-8"?>
<TestCase Name="FiddlerGeneratedWebTest" Id="" Owner="" Description="" Priority="0" Enabled="True" CssProjectStructure="" CssIteration="" DeploymentItemsEditable="" CredentialUserName="" CredentialPassword="" PreAuthenticate="True" Proxy="" RequestCallbackClass="" TestCaseCallbackClass="">
<Items>
<Request Method="POST" Version="1.1" Url="https://example.com/connect/token" ThinkTime="8" Timeout="60" ParseDependentRequests="True" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8">
<ExtractionRules>
<ExtractionRule Classname="Microsoft.VisualStudio.TestTools.WebTesting.Rules.ExtractRegularExpression, Microsoft.VisualStudio.QualityTools.WebTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" VariableName="token" DisplayName="Extract Regular Expression" Description="Extract text from the response matching a regular expression and place it into the test context.">
<RuleParameters>
<RuleParameter Name="RegularExpression" Value=".*"access_token":"([^"]*)".*" />
<RuleParameter Name="IgnoreCase" Value="True" />
<RuleParameter Name="Required" Value="True" />
<RuleParameter Name="Index" Value="0" />
<RuleParameter Name="HtmlDecode" Value="True" />
<RuleParameter Name="UseGroups" Value="True" />
</RuleParameters>
</ExtractionRule>
</ExtractionRules>
<Headers>
<Header Name="Content-Type" Value="application/x-www-form-urlencoded" />
</Headers>
<FormPostHttpBody ContentType="application/x-www-form-urlencoded">
<FormPostParameter Name="client_id" Value="myclientid" UrlEncode="True" />
<FormPostParameter Name="client_secret" Value="password123" UrlEncode="True" />
<FormPostParameter Name="grant_type" Value="client_credentials" UrlEncode="True" />
<FormPostParameter Name="scope" Value="myscopes" UrlEncode="True" />
</FormPostHttpBody>
</Request>
<Request Method="GET" Version="1.1" Url="https://example.com/api/resources" ThinkTime="0" Timeout="60" ParseDependentRequests="True" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8">
<Headers>
<Header Name="Authorization" Value="Bearer {{token}}" />
</Headers>
</Request>
</Items>
</TestCase>
To compliment James Davis's answer, if you need to login to https://yourapp.com/auth/login by posting the JSON:
{
user: 'youruser',
password: 'yourpassword'
}
first base64 encode the json:
> echo "{user: 'youruser', password: 'yourpassword'}" | base64
e3VzZXI6ICd5b3VydXNlcicsIHBhc3N3b3JkOiAneW91cnBhc3N3b3JkJ30K
Then pass this base64 value in a StringHttpBody tag
<?xml version="1.0" encoding="utf-8"?>
<WebTest Name="login-healthcheck" Id="e91b6e1d-3fa0-475f-a18b-b694b463589c" Owner="" Priority="0" Enabled="True" CssProjectStructure="" CssIteration="" Timeout="0" WorkItemIds="" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010" Description="" CredentialUserName="" CredentialPassword="" PreAuthenticate="True" Proxy="default" StopOnError="False" RecordedResultFile="" ResultsLocale="">
<Items>
<Request Method="POST" Guid="ef9d1d00-5663-476a-a3cb-ccf49c4d2229" Version="1.1" Url="https://yourapp.com/auth/login" ThinkTime="8" Timeout="60" ParseDependentRequests="True" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8" ExpectedHttpStatusCode="0" ExpectedResponseUrl="" ReportingName="" IgnoreHttpStatusCode="False">
<Headers>
<Header Name="Content-Type" Value="application/json" />
</Headers>
<ExtractionRules>
<ExtractionRule Classname="Microsoft.VisualStudio.TestTools.WebTesting.Rules.ExtractRegularExpression, Microsoft.VisualStudio.QualityTools.WebTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" VariableName="token" DisplayName="Extract Regular Expression" Description="Extract text from the response matching a regular expression and place it into the test context.">
<RuleParameters>
<RuleParameter Name="RegularExpression" Value=".*"access_token":"([^"]*)".*" />
<RuleParameter Name="IgnoreCase" Value="True" />
<RuleParameter Name="Required" Value="True" />
<RuleParameter Name="Index" Value="0" />
<RuleParameter Name="HtmlDecode" Value="True" />
<RuleParameter Name="UseGroups" Value="True" />
</RuleParameters>
</ExtractionRule>
</ExtractionRules>
<StringHttpBody ContentType="application/json" InsertByteOrderMark="False">e3VzZXI6ICd5b3VydXNlcicsIHBhc3N3b3JkOiAneW91cnBhc3N3b3JkJ30K</StringHttpBody>
</Request>
<Request Method="GET" Guid="d566422f-af74-47bf-90aa-0c66db6ef567" Version="1.1" Url="https://yourapp.com/api/v1/healthcheck" ThinkTime="0" Timeout="60" ParseDependentRequests="True" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8" ExpectedHttpStatusCode="0" ExpectedResponseUrl="" ReportingName="" IgnoreHttpStatusCode="False">
<Headers>
<Header Name="Authorization" Value="Bearer {{token}}" />
</Headers>
</Request>
</Items>
</WebTest>
Worked for me on Azure Application Insights Availability checking

wildfly: How to use encrypted password for a xa-datasource?

I have a wildfly 8.2.0.Final running. I use two oracle datasources, one <datasource> and one <xa-datasource>. I want to have my DB passwords encrypted and managed to do that for the datasource using a security-domain but not for the xa-datasource.
I haven't found documentation or other postings with a solution for this problem.
Here is what I've done:
<datasources>
<datasource jta="false" jndi-name="java:/myproject/jdbc/datasources/jdbc" pool-name="my_JDBC_DS" enabled="true" use-ccm="false">
<connection-url>jdbc:oracle:thin:#localhost:1521:DB</connection-url>
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
<driver>oracle</driver>
<pool>
<min-pool-size>1</min-pool-size>
<max-pool-size>50</max-pool-size>
</pool>
<security>
<security-domain>databaseSecure</security-domain>
</security>
<validation>
<check-valid-connection-sql>select 1 from dual</check-valid-connection-sql>
<validate-on-match>true</validate-on-match>
<background-validation>false</background-validation>
</validation>
</datasource>
<xa-datasource jndi-name="java:/myproject/jdbc/datasources/db_tx" pool-name="MYTXDS" enabled="true" use-ccm="false">
<xa-datasource-property name="URL">
jdbc:oracle:thin:#localhost:1521:DB
</xa-datasource-property>
<xa-datasource-property name="User">
scott
</xa-datasource-property>
<xa-datasource-property name="Password">
tiger
</xa-datasource-property>
<driver>oracle</driver>
<security>
<user-name>scott</user-name>
<password>tiger</password>
</security>
<xa-pool>
<min-pool-size>1</min-pool-size>
<max-pool-size>50</max-pool-size>
<wrap-xa-resource>false</wrap-xa-resource>
</xa-pool>
<validation>
<check-valid-connection-sql>select 1 from dual</check-valid-connection-sql>
<validate-on-match>true</validate-on-match>
<background-validation>false</background-validation>
</validation>
<statement>
<prepared-statement-cache-size>32</prepared-statement-cache-size>
<share-prepared-statements>true</share-prepared-statements>
</statement>
</xa-datasource>
<drivers>
<driver name="oracle" module="oracle">
<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
...
<security-domain name="databaseSecure" cache-type="default">
<authentication>
<login-module code="org.picketbox.datasource.security.SecureIdentityLoginModule" flag="required">
<module-option name="username" value="scott"/>
<module-option name="password" value="-170dd0fbd8c13748"/>
</login-module>
</authentication>
</security-domain>
I've tried removing the xa-datasource-property entries for user and password and referring to the security-domain both nested in the security-tag and on the same level as the properties. Both attempts did not work, with the latter the wildfly exits early because of problems parsing the standalone.xml, with the latter the deployment fails.
To show the most promising attempt, this is how I tried to refer to the security-domain:
<xa-datasource jndi-name="java:/myproject/jdbc/datasources/db_tx" pool-name="MYTXDS" enabled="true" use-ccm="false">
<xa-datasource-property name="URL">
jdbc:oracle:thin:#localhost:1521:DB
</xa-datasource-property>
<driver>oracle</driver>
<security>
<security-domain>databaseSecure</security-domain>
</security>
<xa-pool>
<min-pool-size>1</min-pool-size>
<max-pool-size>50</max-pool-size>
<wrap-xa-resource>false</wrap-xa-resource>
</xa-pool>
<validation>
<check-valid-connection-sql>select 1 from dual</check-valid-connection-sql>
<validate-on-match>true</validate-on-match>
<background-validation>false</background-validation>
</validation>
<statement>
<prepared-statement-cache-size>32</prepared-statement-cache-size>
<share-prepared-statements>true</share-prepared-statements>
</statement>
</xa-datasource>
Doing that the wildfly runs into a javax.resource.ResourceException: No matching credentials in Subject!
I've debugged into the code and although I'm missing the code for the last few classes in the call stack I see that the Subject actually has the credentials as properties but still the AccessController.doPrivilegedcall fails, leading to the above mentioned exception.
You see I'm kind of lost, any suggestions?
I figured it out what I did wrong (by debugging wildfly and staring hard at my working JBoss 4 config..).
In my security-domain configuration I had only set username and password. To make it work I needed to ad the "managedConnectionFactoryName" as well and declare a security-domain for each data source.
I now have the following configuration:
<datasources>
<datasource jta="false" jndi-name="java:/myproject/jdbc/datasources/jdbc" pool-name="my_JDBC_DS" enabled="true" use-ccm="false">
<connection-url>jdbc:oracle:thin:#localhost:1521:DB</connection-url>
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
<driver>oracle</driver>
<pool>
<min-pool-size>1</min-pool-size>
<max-pool-size>50</max-pool-size>
</pool>
<security>
<security-domain>jdbcDatabaseSecure</security-domain>
</security>
<validation>
<check-valid-connection-sql>select 1 from dual</check-valid-connection-sql>
<validate-on-match>true</validate-on-match>
<background-validation>false</background-validation>
</validation>
</datasource>
<xa-datasource jndi-name="java:/myproject/jdbc/datasources/db_tx" pool-name="MYTXDS" enabled="true" use-ccm="false">
<xa-datasource-property name="URL">
jdbc:oracle:thin:#localhost:1521:DB
</xa-datasource-property>
<driver>oracle</driver>
<security>
<security-domain>txDatabaseSecure</security-domain>
</security>
<xa-pool>
<min-pool-size>1</min-pool-size>
<max-pool-size>50</max-pool-size>
<wrap-xa-resource>false</wrap-xa-resource>
</xa-pool>
<validation>
<check-valid-connection-sql>select 1 from dual</check-valid-connection-sql>
<validate-on-match>true</validate-on-match>
<background-validation>false</background-validation>
</validation>
<statement>
<prepared-statement-cache-size>32</prepared-statement-cache-size>
<share-prepared-statements>true</share-prepared-statements>
</statement>
</xa-datasource>
<drivers>
<driver name="oracle" module="oracle">
<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
...
<security-domain name="jdbcDatabaseSecure" cache-type="default">
<authentication>
<login-module code="org.picketbox.datasource.security.SecureIdentityLoginModule" flag="required">
<module-option name="username" value="scott"/>
<module-option name="password" value="-170dd0fbd8c13748"/>
<module-option name = "managedConnectionFactoryName" value="jdbcDatabaseSecure" />
</login-module>
</authentication>
</security-domain>
<security-domain name="txDatabaseSecure" cache-type="default">
<authentication>
<login-module code="org.picketbox.datasource.security.SecureIdentityLoginModule" flag="required">
<module-option name="username" value="scott"/>
<module-option name="password" value="-170dd0fbd8c13748"/>
<module-option name = "managedConnectionFactoryName" value="txDatabaseSecure" />
</login-module>
</authentication>
</security-domain>
And now it works.
I had the same issue when trying to configure xa-datasource with an encrypted security-domains. After struggling a while, I configured vault encryption as described in this guide https://developer.jboss.org/wiki/JBossAS7SecuringPasswords and it works sucessfully with both datasources and xa-datasources.
Hope this helps.
i disabled caching of security-domain by removing cache-type="default" from security-domain in standalone.xml and it works for me
This happens where multiple datasources are defined backed by the same security domain,
- Either make separte security-domain for each datasource or
- if a security domain is to be used with multiple datasources then no caching should be enabled for that domain, this means that each time the PasswordCredential is obtained from the security domain it will be a new instance and do do this remove cache-type="default" from security-domain in standalone.xml
References:
https://community.appian.com/support/w/kb/299/kb-1074-cannot-open-connection-caused-by-javax-resource-resourceexception-no-matching-credentials-in-subject-error-thrown-during-jboss-startup
https://bugzilla.redhat.com/show_bug.cgi?id=1103684

Office365 outlook add-in commands

I'm using the following manifest to add addin command in outlook 2016.
<?xml version="1.0" encoding="utf-8"?>
<OfficeApp xsi:type="MailApp"
xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0"
xmlns:mailappor="http://schemas.microsoft.com/office/mailappversionoverrides/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/office/appforoffice/1.1">
<Id></Id>
<Version>1.0.0.0</Version>
<ProviderName></ProviderName>
<DefaultLocale>en-US</DefaultLocale>
<DisplayName DefaultValue="" />
<Description DefaultValue="" />
<SupportUrl DefaultValue="" />
<Hosts>
<Host Name="Mailbox" />
</Hosts>
<Requirements>
<Sets>
<Set Name="MailBox" MinVersion="1.1" />
</Sets>
</Requirements>
<FormSettings>
<Form xsi:type="ItemRead">
<DesktopSettings>
<SourceLocation DefaultValue="~remoteAppUrl/AppRead/Home/home.html" />
<RequestedHeight>250</RequestedHeight>
</DesktopSettings>
<TabletSettings>
<SourceLocation DefaultValue="~remoteAppUrl/AppRead/Home/home.html" />
<RequestedHeight>250</RequestedHeight>
</TabletSettings>
<PhoneSettings>
<SourceLocation DefaultValue="~remoteAppUrl/AppRead/Home/home.html" />
</PhoneSettings>
</Form>
<Form xsi:type="ItemEdit">
<DesktopSettings>
<SourceLocation DefaultValue="~remoteAppUrl/AppRead/Home/home.html" />
</DesktopSettings>
<TabletSettings>
<SourceLocation DefaultValue="~remoteAppUrl/AppRead/Home/home.html" />
</TabletSettings>
<PhoneSettings>
<SourceLocation DefaultValue="~remoteAppUrl/AppRead/Home/home.html" />
</PhoneSettings>
</Form>
</FormSettings>
<Permissions>ReadWriteMailbox</Permissions>
<Rule xsi:type="RuleCollection" Mode="Or">
<Rule xsi:type="ItemIs" ItemType="Message" FormType="Read" />
<Rule xsi:type="ItemIs" ItemType="Message" FormType="ReadOrEdit" />
<Rule xsi:type="ItemIs" ItemType="Appointment" FormType="Read" />
<Rule xsi:type="ItemIs" ItemType="Appointment" FormType="ReadOrEdit" />
</Rule>
<VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides" xsi:type="VersionOverridesV1_0">
<Description resid="residDescription" />
<Requirements>
<bt:Sets DefaultMinVersion="1.3">
<bt:Set Name="Mailbox" />
</bt:Sets>
</Requirements>
<Hosts>
<Host xsi:type="MailHost">
<DesktopFormFactor>
<FunctionFile resid="residDesktopFuncUrl" />
<ExtensionPoint xsi:type="MessageComposeCommandSurface">
<OfficeTab id="TabDefault">
<Group id="msgreadTabMessage.grp1">
<Label resid="residTemplateManagement" />
<Tooltip resid="residTemplateManagementTip" />
<Control xsi:type="Button" id="msgreadTabMessage.grp1.btnView">
<Label resid="residViewTemplates" />
<Tooltip resid="residViewTemplatesTip" />
<Supertip>
<Title resid="residVewAndManageTemplates" />
<Description resid="residViewManageTemplatesSprTip" />
</Supertip>
<Icon>
<bt:Image size="16" resid="icon1_16x16" />
<bt:Image size="32" resid="icon1_32x32" />
<bt:Image size="80" resid="icon1_80x80" />
</Icon>
<Action xsi:type="ShowTaskpane">
<SourceLocation resid="residManageTemplatesUrl" />
</Action>
</Control>
</Group>
</OfficeTab>
</ExtensionPoint>
</DesktopFormFactor>
</Host>
</Hosts>
<Resources>
<bt:Images>
<bt:Image id="icon1_16x16" DefaultValue="https://contoso.com/owa/images/app_icon_small.png" >
</bt:Image>
<bt:Image id="icon1_32x32" DefaultValue="https://contoso.com/owa/images/app_icon.png" >
</bt:Image>
<bt:Image id="icon1_80x80" DefaultValue="https://contoso.com/owa/images/app_icon_large.png" >
</bt:Image>
</bt:Images>
<bt:Urls>
<bt:Url id="residDesktopFuncUrl" DefaultValue="~remoteAppUrl/AppRead/Home/home.html" >
</bt:Url>
<bt:Url id="residManageTemplatesUrl" DefaultValue="~remoteAppUrl/AppRead/Home/home.html">
</bt:Url>
<bt:Url id="residAddNewTemplateUrl" DefaultValue="~remoteAppUrl/AppRead/Home/home.html">
</bt:Url>
</bt:Urls>
<bt:ShortStrings>
<bt:String id="residTemplateManagement" DefaultValue="Do.com">
</bt:String>
<bt:String id="residViewTemplates" DefaultValue="Launch Do.com">
</bt:String>
<bt:String id="residVewAndManageTemplates" DefaultValue="View and Manage Templates">
</bt:String>
</bt:ShortStrings>
<bt:LongStrings>
<bt:String id="residDescription" DefaultValue="Use this app to automatically scan outgoing mails and insert content according to customizable mark-up. This app will not share your data with any third-party service.">
</bt:String>
<bt:String id="residTemplateManagementTip" DefaultValue="Operations for managing your template collection">
</bt:String>
<bt:String id="residViewTemplatesTip" DefaultValue="Open a taskpane to display and manage your current templates">
</bt:String>
<bt:String id="residViewManageTemplatesSprTip" DefaultValue="Open a taskpane that will display all templates saved under your profile and default templates provided by the service. From this pane you can add, remove, or change template properties.">
</bt:String>
<bt:String id="residMyTemplatesTabTip" DefaultValue="Insert content from a saved collection of prepared data, or embed tags into your mail that are automatically replaced on send!">
</bt:String>
</bt:LongStrings>
</Resources>
</VersionOverrides>
</OfficeApp>
But the button is not getting added into ribbon. If i remove the "VersionOverrides" the addin is getting shown in outlook 2016.
So, the VersionOverrides is working but somehow the button is not getting shown inside mail during read and in the list of addins in compose mode.
What am I missing?
Use this sample to grab a manifest, which you can edit to your liking: github.com/jasonjoh/command-demo
The URLs in your manifest need to be reachable. You have a lot that start with remoteAppUrl, and some that are contoso.com.

Error cvc-elt.1.a: Cannot find the declaration of element 'soapenv:Body'

I have already tried some hints but I get this problem not solved. I validated the wsdl with xmlspy-client and it says it and the xsd are valid.
When I send a Request like this with SOAPUI I get the Exception mentioned (cvc-elt.1.a: Cannot find the declaration of element 'soapenv:Body').
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://schemas.domain.com/wsdl/fuelprice/v1" xmlns:mod="http://schemas.domain.com/wsdl/fuelprice/v1/model">
<soapenv:Header/>
<soapenv:Body>
<v1:AuthenticationHeader client="client">
<v1:token>token</v1:token>
</v1:AuthenticationHeader>
<v1:GetAreaFuelStationsRequest provider="p1" prices="true">
<v1:area>
<mod:center ellipsoid="false">
<mod:latitude>22.519172</mod:latitude>
<mod:longitude>13.406093</mod:longitude>
</mod:center>
<mod:radius>10</mod:radius>
</v1:area>
</v1:GetAreaFuelStationsRequest>
</soapenv:Body>
</soapenv:Envelope>
I have tried importing the soap schema in the wsdl. After it I got an error message:
"cvc-complex-type.2.4.a: Invalid content was found starting with element 'v1:latitude'. One of '{"http://schemas.domain.com/wsdl/fuelprice/v1/model":latitude}' is expected.".
I honestly work with rest and json and have some difficulties with this schema-configuration.
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="wsdl-viewer.xsl"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://schemas.domain.com/wsdl/fuelprice/v1" xmlns:model="http://schemas.domain.com/wsdl/fuelprice/v1/model" xmlns:exception="http://schemas.domain.com/wsdl/fuelprice/v1/exception" targetNamespace="http://schemas.domain.com/wsdl/fuelprice/v1">
<wsdl:types>
<xsi:schema xmlns:xsi="http://www.w3.org/2001/XMLSchema" targetNamespace="http://schemas.domain.com/wsdl/fuelprice/v1" elementFormDefault="qualified">
<xsi:import namespace="http://schemas.domain.com/wsdl/fuelprice/v1/model" schemaLocation="common.xsd"/>
<xsi:import namespace="http://schemas.domain.com/wsdl/fuelprice/v1/exception" schemaLocation="exception.xsd"/>
<xsi:element name="GetAreaFuelStationsRequest">
<xsi:complexType>
<xsi:sequence>
<xsi:element name="area" type="model:Area"/>
</xsi:sequence>
<xsi:attribute name="provider" type="xsi:string" use="optional"/>
<xsi:attribute name="prices" type="xsi:boolean" use="required"/>
</xsi:complexType>
</xsi:element>
<xsi:element name="GetAreaFuelStationsResponse">
<xsi:complexType>
<xsi:sequence>
<xsi:element name="entry" type="model:SearchResult" minOccurs="0" maxOccurs="unbounded"/>
</xsi:sequence>
<xsi:attribute name="countTotal" type="xsi:int" use="optional"/>
</xsi:complexType>
</xsi:element>
</xsi:schema>
</wsdl:types>
<wsdl:message name="SearchAreaFuelStationsRequest">
<wsdl:part name="auth" element="tns:AuthenticationHeader"/>
<wsdl:part name="body" element="tns:GetAreaFuelStationsRequest"/>
</wsdl:message>
<wsdl:message name="SearchAreaFuelStationsResponse">
<wsdl:part name="body" element="tns:GetAreaFuelStationsResponse"/>
</wsdl:message>
<wsdl:portType name="FuelDataService">
<wsdl:operation name="GetAreaFuelStations">
<wsdl:input message="tns:GetAreaFuelStationsRequest"/>
<wsdl:output message="tns:GetAreaFuelStationsResponse"/>
<wsdl:fault name="ServiceError" message="tns:ServiceErrorFault"/>
<wsdl:fault name="AuthenticationError" message="tns:AuthenticationErrorFault"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="FuelDataService" type="tns:FuelDataService">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="GetAreaFuelStations">
<soap:operation soapAction="urn:GetAreaFuelStations"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="ServiceError"/>
<wsdl:fault name="AuthenticationError"/>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="FuelDataService">
<wsdl:port name="FuelDataService" binding="tns:FuelDataService">
<soap:address location="No target address"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
The XSD:
<?xml version="1.0" encoding="UTF-8"?>
<xsi:schema xmlns:xsi="http://www.w3.org/2001/XMLSchema" xmlns:model="http://schemas.domain.com/wsdl/fuelprice/v1/model" targetNamespace="http://schemas.domain.com/wsdl/fuelprice/v1/model" elementFormDefault="qualified">
<xsi:complexType name="FuelStation">
<xsi:sequence>
<xsi:element name="location" type="model:GeoLocation"/>
<xsi:element name="name" type="xsi:string"/>
</xsi:sequence>
<xsi:attribute name="id" type="xsi:long" use="optional"/>
</xsi:complexType>
<xsi:complexType name="GeoLocation">
<xsi:sequence>
<xsi:element name="latitude" type="xsi:double"/>
<xsi:element name="longitude" type="xsi:double"/>
</xsi:sequence>
<xsi:attribute name="ellipsoid" type="xsi:string" use="required"/>
</xsi:complexType>
<xsi:complexType name="Area">
<xsi:sequence>
<xsi:element name="center" type="model:GeoLocation"/>
<xsi:element name="radius" type="xsi:float"/>
</xsi:sequence>
</xsi:complexType>
</xsi:schema>
For me is not obvious what I should change to get this working. Does anybody knows what is wrong with the namespace setting? I would appreciate any help.
This Question was solved with the Question validating SOAP-Request with a SOAPHandler
Extracting the body of message, adding the needed namespace in the schema and validating the body as a Document did the trick.

Resources