Error calling container "containername": Session 'defaultKieSession' not found on container - rest

I want to call drools via kie server per REST-Call.
I created a container with runtime strategy "Singleton" without Kie Basis Name and without Kie Session Name.
Here is my rest call:
- URL: http://10.199.0.211:8080/kie-server-6.5.0.Final-ee7/services/rest/server/containers/instances/test1
- Authorization: basic
- Header: Content-Type: application/xml
Body:
<batch-execution lookup="defaultKieSession">
<insert out-identifier="message" return-object="true" entrypoint="DEFAULT">
<de.salt.d4s.test2.test2.input>
<order>1</order>
</de.salt.d4s.test2.test2.input>
</insert><fire-all-rules></fire>
</batch-execution>
I get this result:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<response type="FAILURE" msg="Error calling container test1: Session
'defaultKieSession' not found on container 'test1'."/>
I tried to do this with a "kie session name" in process-configuration but got the same error.
What can I do to solve this?
Thank you!
Michael

Check if, in the directory resources/META-INF, the file kmodule.xml contains a default ksession, if not you can place it:
<kmodule xmlns="http://jboss.org/kie/6.0.0/kmodule" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<kbase name="myBase" default="true">
<ksession name="mySession" type="stateless" default="true" clockType="realtime"/>
<ksession name="mySession2" default="true" clockType="realtime"/>
</kbase>
</kmodule>
For more details about the xml values you can take a look here:
https://docs.jboss.org/drools/release/6.2.0.CR3/drools-docs/html/KIEChapter.html#d0e1533

Related

Getting Soap Body from Web Service Consumer

I have a web service consumer in a flow and simply want to extract the XML contained in the soap envelope to be put on the outbound vm queue. How can I accomplish that in a flow, I have shown a sample of the soap message;
<ws:consumer-config name="WS_Connector"
connector-ref="HTTP_HTTPS" wsdlLocation="orderService.wsdl"
service="OrderService" port="OrderServiceWS"
serviceAddress="http://ws-orders.com?responseTimeout=60000"
doc:name="Web Service Consumer" />
<flow name="mainFlow">
<vm:inbound-endpoint path="request.queue"/>
<ws:consumer config-ref="WS_Connector"
operation="orderTShirts" doc:name="TShirt Service Consumer">
</ws:consumer>
<!-- Get Just the XML Payload without the Soap Envelope
for the vm outbound queue
<tshirt xmlns="http://www.webservice.order-service">
<size>17</size>
<color>red</color>
</tshirt>
-->
<vm:outbound-endpoint path="response.queue"/>
</flow>
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<tshirt xmlns="http://www.webservice.order-service">
<size>17</size>
<color>red</color>
</tshirt>
</soap:Body>
</soap:Envelope>
The web-service-consumer is designed to only accept the body/operation part of the XML document and will produce body/operation in response.
Pls go through the dataweave document :- https://docs.mulesoft.com/mule-user-guide/v/3.7/web-service-consumer
What you can do here use XSLT transforer or DataWeave to add your soap envelope after your <ws:consumer/> in the response something like following example :-
<!-- your code above -->
<ws:consumer config-ref="WS_Connector" operation="orderTShirts" doc:name="TShirt Service Consumer"/>
<dw:transform-message doc:name="XML to JSON" >
<dw:input-payload doc:sample="ListInventoryResponse.xml"/>
<dw:set-payload><![CDATA[%dw 1.0
%output application/xml
%namespace ns0 http://mulesoft.org/tshirt-service
%namespace soap http://schemas.xmlsoap.org/soap/envelope/
---
soap#Envelope : {
soap#Body:payload
}]]></dw:set-payload>
</dw:transform-message>
The solution I found is quite simple
<mulexml:dom-to-xml-transformer doc:name="SOAP Response to XML" encoding="UTF-8" mimeType="application/xml" outputEncoding="UTF-8"/>

Subscribe push notification using ews

I tried to subscribe push notification for calendar event using ews soap request. But unfortunately it failed
Error: The request failed schema validation: Could not find schema information for the element 'Subscribe'.
I follow the link :
https://msdn.microsoft.com/en-us/library/office/aa566188%28v=exchg.150%29.aspx#sectionSection3
Could you please give any solution for that or any resource.
My EWS soap request :
`
</t:RequestServerVersion><t:TimeZoneContext><t:TimeZoneDefinition Name="UTC" Id="UTC"></t:TimeZoneDefinition></t:TimeZoneContext>
<t:ExchangeImpersonation>
<t:ConnectingSID>
<t:PrimarySmtpAddress>test email address</t:PrimarySmtpAddress>
</t:ConnectingSID>
</t:ExchangeImpersonation>
</soap:Header>
<soap:Body>
<Subscribe xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<PushSubscriptionRequest xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
<FolderIds xmlns="http://schemas.microsoft.com/exchange/services/2006/types">
<DistinguishedFolderId Id="calendar" />
</FolderIds>
<EventTypes xmlns="http://schemas.microsoft.com/exchange/services/2006/types">
<EventType>CreatedEvent</EventType>
<EventType>DeletedEvent</EventType>
<EventType>ModifiedEvent</EventType>
</EventTypes>
<StatusFrequency xmlns="http://schemas.microsoft.com/exchange/services/2006/types">1</StatusFrequency>
<URL xmlns="http://schemas.microsoft.com/exchange/services/2006/types">My own website url</URL>
</PushSubscriptionRequest>
</Subscribe>
`
Response
`<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<s:Fault>
<faultcode xmlns:a="http://schemas.microsoft.com/exchange/services/2006/types">a:ErrorSchemaValidation</faultcode>
<faultstring xml:lang="en-US">The request failed schema validation: Could not find schema information for the element 'Subscribe'.</faultstring>
<detail>
<e:ResponseCode xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">ErrorSchemaValidation</e:ResponseCode>
<e:Message xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">The request failed schema validation.</e:Message>
<t:MessageXml xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<t:LineNumber>17</t:LineNumber>
<t:LinePosition>6</t:LinePosition>
<t:Violation>Could not find schema information for the element 'Subscribe'.</t:Violation>
</t:MessageXml>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>`
You are missing namespace for Subscribe tag. Soething like:
<m:Subscribe xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages">

Windows Azure Graph AD Creating Group using Rest API

I'm trying to create a group using the rest API of windows azure Graph for Office365. I'm pass the xml payload to the url https://graph.windows.net/49aa83c813-59c999-4e29-a753-25fd8caebe93/Group
The payLoad which I'm passing is
<?xml version="1.0" encoding="UTF-8" standalone="no"?><entry xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><content type="application/xml"><m:properties><d:DisplayName>testingGroup</d:DisplayName><d:Description>Test group</d:Description><d:MailEnabled>true</d:MailEnabled><d:DirSyncEnabled>false</d:DirSyncEnabled><d:SecurityEnabled>false</d:SecurityEnabled><d:ObjectType>Group</d:ObjectType><d:MailNickname>firstGroup</d:MailNickname><d:Mail>firstGroup#companyName.us</d:Mail></m:properties></content></entry>
I receive a 400 Error as a response. Will anyone be able to tell me the correct XML payLoad to pass.
First, your request URI is incorrect. For creating a group using version 0.8 of the Graph API, it should be in this format:
https://graph.windows.net/yourtenantdomainname.com/Group
Your tenant might also be an *.onmicrosoft.com address. A couple other things: the service currently doesn't support setting the DirSyncEnabled or Mail properties. They are both read-only. And currently you need to have MailEnabled set to false and SecurityEnabled set to true.
To create a group using 0.8 version, this is what your request will look like:
POST https://graph.windows.net/yourtenantname.com/Groups HTTP/1.1
Authorization: Bearer eyJ0eXAiOiJK...vYiFqfkg
Host: graph.windows.net
Content-Type: application/atom+xml
x-ms-dirapi-data-contract-version: 0.8
Content-Length: 725
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<content type="application/xml">
<m:properties>
<d:DisplayName>testingGroup</d:DisplayName>
<d:Description>Test group</d:Description>
<d:MailEnabled>false</d:MailEnabled>
<d:ObjectType>Group</d:ObjectType>
<d:SecurityEnabled>true</d:SecurityEnabled>
<d:MailNickname>firstGroup</d:MailNickname>
</m:properties>
</content>
</entry>
Note that 0.9 of the Graph API was released recently: http://blogs.msdn.com/b/aadgraphteam/archive/2013/03/03/0-9-version-of-azure-active-directory-graph-now-available.aspx
If you want to create a group using the latest version of the API, this is how your request would look using XML as the payload (note the camelCase properties and "group" in the URI):
POST https://graph.windows.net/yourtenantname.com/groups?api-version=0.9 HTTP/1.1
Authorization: Bearer eyJ0eXAi...YiFqfkg
Host: graph.windows.net
Content-Type: application/atom+xml
Content-Length: 627
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<content type="application/xml">
<m:properties>
<d:displayName>testingGroup</d:displayName>
<d:description>Test group</d:description>
<d:mailEnabled>false</d:mailEnabled>
<d:objectType>Group</d:objectType>
<d:securityEnabled>true</d:securityEnabled>
<d:mailNickname>firstGroup</d:mailNickname>
</m:properties>
</content>
</entry>
And finally just for fun, if you want to use the new supported minimal JSON the payload would look like this:
{
"displayName": "testingGroup",
"description": "Test group",
"mailNickname": "firstGroup",
"mailEnabled": false,
"securityEnabled": true
}

Status - SyncStatusParam returns all objects

I am trying to use SyncStatusParam to retrieve Status of an object. Instead it returned all objects that were even sent to QuickBooks cloud. If I go back to use the NgIdSet which has been deprecated, then it worked fine.
The XML I sent was:
<?xml version="1.0" encoding="UTF-8"?>
<SyncStatusRequest xmlns="http://www.intuit.com/sb/cdm/v2" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<OfferingId>ipp</OfferingId>
<SyncStatusParam>
<IdSet><Id idDomain="NG">11019504</Id></IdSet>
<SyncToken>1</SyncToken>
<ObjectType>Bill</ObjectType>
</SyncStatusParam>
</SyncStatusRequest>

Why are my entities disapearing after deploy?

I created an OData service for a couple of our entities, and on my developer machine (WinXP), everything works like it should, this is what I get when accessing the service:
<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
<service xml:base="http://localhost:2332/ContactOData.svc/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app" xmlns="http://www.w3.org/2007/app">
<workspace>
<atom:title>Default</atom:title>
<collection href="Client">
<atom:title>Client</atom:title>
</collection>
<collection href="Vehicle">
<atom:title>Vehicle</atom:title>
</collection>
<collection href="Contact">
<atom:title>Contact</atom:title>
</collection>
</workspace>
</service>
Now after I deployed that service to a testserver (Win2K3), all my entities are gone:
<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
<service xml:base="http://dev-cont2011b/ContactOData/ContactOData.svc/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app" xmlns="http://www.w3.org/2007/app">
<workspace>
<atom:title>Default</atom:title>
</workspace>
</service>
There are no error messages, nothing in the event log. My connections string is ok (I tested this with a simple test.aspx page which fetches something out of the database and shows it on the page ==> this works).
When I manually enter the url for one of the entities (Client), this is what I get:
<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<code></code>
<message xml:lang="nl-BE">Resource not found for the segment 'Client'.</message>
</error>
The .NET Framework 3.5 is installed on that server. I ran all the updates.
I've been banging my head on this one for the last couple of hours. I don't know what else I can do or test.
Any suggestions?
The solution was to install this update:
ADO.NET Data Services Update for .NET Framework 3.5 SP1 for Windows Server 2003, Windows XP, Windows Vista and Windows Server 2008
Apparently, this one isn't included into windows update by default. You have to run it manually.
This was needed because I changed the default InitializeService method so it takes a DataServiceConfiguration in stead of an IDataServiceConfiguration:
public static void InitializeService(DataServiceConfiguration config)
{
config.SetEntitySetAccessRule("*", EntitySetRights.AllRead);
config.DataServiceBehavior.MaxProtocolVersion = System.Data.Services.Common.DataServiceProtocolVersion.V2;
config.SetEntitySetPageSize("*", 20);
}
This is needed if you want to enable server side paging (SetEntitySetPageSize) (amongst others).
New try:
It is a RESX problem
<message xml:lang="nl-BE">Resource not found for the segment 'Client'.</message>
It is trying to lookup the nl-BE translation for the name Client.