icCube XMLA request documentation - soap

Is there any documentation on how to formulate a request to the XMLA?
The icCube XMLA endpoint for me is: http://localhost:8282/icCube/xmla
I want to make a demo call to the endpoint using postman or something similar, but I am not sure which parameters to pass in the SOAP request.
I have tried:
<x:Envelope xmlns:x="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:schemas-microsoft-com:xml-analysis">
<x:Header>
<urn:Session SessionId="?" mustUnderstand="?"/>
<urn:BeginSession mustUnderstand="?"/>
<urn:EndSession SessionId="?" mustUnderstand="?"/>
</x:Header>
<x:Body>
<urn:Execute>
<Command>
<Statement>
SELECT
{[Customers].[Geography].[All Regions].[North America].[Canada].[Ottawa]} on COLUMNS,
{[Measures].[Count]} on ROWS
FROM [Sales]
</Statement>
</Command>
<Properties/>
</urn:Execute>
</x:Body>
</x:Envelope>
And I get an empty response:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<Session SessionId="1hb96vaa7acol14bj97tyokd4f" xmlns="urn:schemas-microsoft-com:xml-analysis"/>
</soap:Header>
<soap:Body>
<ExecuteResponse xmlns="urn:schemas-microsoft-com:xml-analysis">
<return>
<root xmlns="urn:schemas-microsoft-com:xml-analysis:empty"/>
</return>
</ExecuteResponse>
</soap:Body>
</soap:Envelope>
Does anyone know where I can find some more information on how to make this request? The icCube documentation at http://www.iccube.com/support/documentation/user_guide/running_iccube/xmla.php is basically non-existent.
Thank you in advance for any help.

I had to add the correct properties information to the soap call:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<Execute xmlns="urn:schemas-microsoft-com:xml-analysis" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<Command>
<Statement>
SELECT
{[Customers].[Geography].[All Regions].[North America].[Canada].[Ottawa]} on COLUMNS,
{[Measures].[Count]} on ROWS
FROM [Sales]
</Statement>
</Command>
<Properties>
<PropertyList>
<Catalog>Sales</Catalog>
</PropertyList>
</Properties>
</Execute>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
The best documentation I have been able to find for the XMLA is the XML for Analysis Specification.

Related

.Net is messing up SOAP request format

0
I am using .net6 to connect to a SOAP service.
Here is the body that they expect to receive.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://www.me.com/cpm/xsd/mcpservices/security/v1" xmlns:v11="http://www.me.com/cpm/xsd/mcpservices/cardholdermanagement/v1" xmlns:v12="http://www.me.com/cpm/xsd/mcpservices/base/v1">
<soapenv:Header>
<v1:requestSecurity>
<v1:userName/>
<v1:senderId>Test Desktop</v1:senderId>
<v1:correlationId>000001</v1:correlationId>
<v1:prel>122</v1:prel>
</v1:requestSecurity>
</soapenv:Header>
<soapenv:Body>
<v11:cardAvailablityRequest>
<v12:servicingCentre>90</v12:servicingCentre>
<v12:channel>WEB</v12:channel>
<v11:prel>122</v11:prel>
<v11:lastFourOfCardNumber>2222</v11:lastFourOfCardNumber>
</v11:cardAvailablityRequest>
</soapenv:Body>
</soapenv:Envelope>
However if I look at the request I am sending via the
Request.Content.Message
property
I see this
<?xml version="1.0" encoding="utf-16"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">urn:checkCardAvailability</Action>
<h:requestSecurity xmlns:h="http://www.me.com/cpm/xsd/mcpservices/security/v1" xmlns="http://www.me.com/cpm/xsd/mcpservices/security/v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<userName>name</userName>
<senderId>Test Desktop</senderId>
<correlationId>000001</correlationId>
<prel>122</prel>
</h:requestSecurity>
</s:Header>
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<h:cardAvailablityRequest>
<servicingCentre>90</v12:servicingCentre>
<channel>WEB</v12:channel>
<prel>122</v11:prel>
<cardNumber>2222</v11:cardNumber>
</h:cardAvailablityRequest>
</s:Body>
</s:Envelope>
What on earth is going on? I used their WSDL to automatically create the proxy classes etc in Visual Studio. I would have thought those classes would form the SOAP correctly?
The WSDL has no instances of the text V11 or V12 so I have no idea how it could possibly know to put those in the Body...
Interestingly if I import the WSDL into SOAPUI it produces the correct Request format (Identical to the top request). Why is .net corrupting the format?

How to create sales order in Netsuite using SOAP API with TBA credentials?

I have spent more time on creating Sales order in Netsuite using SOAP API with SOAP API. I have tried the following payload and getting error message as Invalid SOAPAction header: get
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<ns1:preferences xmlns:ns1="urn:messages_2017_2.platform.webservices.netsuite.com">
<ns1:warningAsError>false</ns1:warningAsError>
<ns1:ignoreReadOnlyFields>true</ns1:ignoreReadOnlyFields>
</ns1:preferences>
<ns2:tokenPassport soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns:ns2="urn:messages_2017_2.platform.webservices.netsuite.com">
<ns3:account xmlns:ns3="urn:core_2017_2.platform.webservices.netsuite.com">{{account}}</ns3:account>
<ns3:consumerKey xmlns:ns3="urn:core_2017_2.platform.webservices.netsuite.com">{{consumerKey}}</ns3:consumerKey>
<ns3:token xmlns:ns3="urn:core_2017_2.platform.webservices.netsuite.com">{{tokenId}}</ns3:token>
<ns3:nonce xmlns:ns3="urn:core_2017_2.platform.webservices.netsuite.com">{{nonce}}</ns3:nonce>
<ns3:signature algorithm="HMAC-SHA256" xmlns:ns3="urn:core_2017_2.platform.webservices.netsuite.com">{{signature}}</ns3:signature>
</ns2:tokenPassport>
</soapenv:Header>
<soapenv:Body>
<add xmlns="urn:messages_2017_2.platform.webservices.netsuite.com">
<record xsi:type="ns4:SalesOrder" xmlns:ns4="urn:sales_2017_2.transactions.webservices.netsuite.com">
<ns4:entity internalId="1655 customer" xsi:type="ns5:RecordRef"
xmlns:ns5="urn:core_2017_2.platform.webservices.netsuite.com">
<ns5:name xsi:type="xsd:string">LAZADA-SG1</ns5:name>
</ns4:entity>
<ns4:tranDate xsi:type="xsd:dateTime">2017-12-14T18:16:44.000Z</ns4:tranDate>
<ns4:shipAddressList internalId="84" xsi:type="ns6:RecordRef"
xmlns:ns6="urn:core_2017_2.platform.webservices.netsuite.com"/>
<ns4:itemList replaceAll="true" xsi:type="ns4:SalesOrderItemList">
<ns4:item xsi:type="ns4:SalesOrderItem">
<ns4:item internalId="387 inventoryItem" xsi:type="ns7:RecordRef"
xmlns:ns7="urn:core_2017_2.platform.webservices.netsuite.com"/>
<ns4:quantity xsi:type="xsd:double">2.0</ns4:quantity>
</ns4:item>
</ns4:itemList>
</record>
</add>
</soapenv:Body>
</soapenv:Envelope>
Also, I have tried different versions.
Can someone help to share the sample SOAP XML payload to create Sales order in netsuite?
It's working
Here I have got the payload to POST the sales order successfully in Netsuite with basic details
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Header>
<preferences xmlns="urn:messages_2020_1.platform.webservices.netsuite.com">
<warningAsError>false</warningAsError>
<ignoreReadOnlyFields>true</ignoreReadOnlyFields>
</preferences>
<tokenPassport xsi:type="TokenPassport">
<account>{{account}}</account>
<consumerKey>{{consumerKey}}</consumerKey>
<token>{{tokenId}}</token>
<nonce>{{nonce}}</nonce>
<timestamp>{{timestamp}}</timestamp>
<signature algorithm="HMAC-SHA256">{{signature}}=</signature>
</tokenPassport>
</soap:Header>
<soap:Body>
<add>
<record xsi:type="tranSales:SalesOrder" xmlns:tranSales="urn:sales_2020_1.transactions.webservices.netsuite.com">
<entity internalId="1655"/>
<itemList>
<item>
<item internalId="387"/>
<quantity>3</quantity>
<amount>45.3</amount>
</item>
</itemList>
</record>
</add>
</soap:Body>
</soap:Envelope>

Element not allowed: node#http://schemas.xmlsoap.org/soap/envelope

I am getting the following error, when I add a SOAP UI schema validation for as part of the assertions in SOAP UI:
Element not allowed: node#http://schemas.xmlsoap.org/soap/envelope in element Header#http://schemas.xmlsoap.org/soap/envelope
Can anyone please give me a clue why this is failing? And how to fix that?
XML validated:
<soap:Envelope xmlns:ns0="urn:xeu:flux-transport:v1" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<soap:node datetime="2018-02-02T10:31:08.006Z">ABC</soap:processingNode>
</soap:Header>
<soap:Body>
<blah>
</blah>
</soap:Body>
</soap:Envelope>
WSDL (used to validate in SOAP UI):
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:documentation>Version: 1.0</wsdl:documentation>
<wsdl:types>
<xsd:schema>
<import namespace="http://schemas.xmlsoap.org/soap/envelope/"
schemaLocation="http://schemas.xmlsoap.org/soap/envelope/" />
</xsd:schema>
</wsdl:types>
</wsdl:definitions>
Any help appreciated.
Remove the element node or below line from your request:
<soap:node datetime="2018-02-02T10:31:08.006Z">ABC</soap:processingNode>
Also, start and end node names are different too.

Accumulating SOAP responses together with SOAP requests through wso2esb mediation

I have a SOAP web service which can be accessed like:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:sys="system">
<soap:Body>
<sys:getAccountInfo>
<account id="132456"/>
</sys:getAccountInfo>
</soap:Body>
</soap:Envelope>
This web service would provide the following response:
<S:Envelope xmlns:S="http://www.w3.org/2003/05/soap-envelope">
<S:Body>
<ns1:getAccountInfoResponse xmlns:ns1="system">
<balance value="555">
</ns1:getAccountInfoResponse>
</S:Body>
</S:Envelope>
My challenge is to provide a proxyfying service which can accept multiple accounts as an input and respond with balance for each one like the following:
Request into proxy:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:sys="systemProxy" xmlns:inner="innerProxyNamespace">
<soap:Body>
<sys:getAccountInfo>
<inner:account id="123456"/>
<inner:account id="123457"/>
<inner:account id="123458"/>
</sys:getAccountInfo>
</soap:Body>
</soap:Envelope>
Proxy response:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:sys="systemProxy" xmlns:inner="innerProxyNamespace">
<soap:Body>
<sys:getAccountInfoResponse>
<inner:account id="123456">
<inner:balance value="555"/>
</inner:account>
<inner:account id="123457">
<inner:balance value="666"/>
</inner:account>
<inner:account id="123458">
<inner:balance value="777"/>
</inner:account>
</sys:getAccountInfoResponse>
</soap:Body>
<soap:Envelope>
I am using Iterate and Aggregate mediator for splitting incoming request into multiple requests to backend and accumulating responses from backend into single message. The problem is I can not find the right way to include account id into proxy response even with Enrich mediator.
I do iteration sequence like this:
<!-- it is correct proxy incoming message format -->
<iterate attachPath="soap:Body/sys:getAccountInfo"
expression="$body/sys:getAccountInfo/account"
preservePayload="true"
xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:sys="systemProxy">
<target>
<sequence>
<payloadFactory>
<!-- payloadFactory configuration skipped -->
</payloadFactory>
<enrich>
<source clone="true" type="body"/>
<target property="originalRequest" type="property"/>
</enrich>
<send>
<endpoint key="BackendEndpoint"/>
</send>
</sequence>
</target>
</iterate>
So the question is - what is the right way to aggregate all response messages from backend into one preserving data from the original request?
I used Propetry and PayloadFactory mediators before the Aggregate mediator. It let me include request into response before aggregation. Then I aggregated them all together.

InternalServerError when making PullSubscription with SubscribeToAllFolders

I'm trying to use the PullSubscription with the SubscrubeToAllFolders attribute as documented on the Microsoft Office Dev Center:
<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<s:Header>
<t:RequestServerVersion Version="Exchange2013_SP1" />
</s:Header>
<s:Body>
<m:Subscribe>
<m:PullSubscriptionRequest SubscribeToAllFolders="">
<t:FolderIds />
<t:EventTypes>
<t:EventType>CopiedEvent</t:EventType>
<t:EventType>CreatedEvent</t:EventType>
<t:EventType>DeletedEvent</t:EventType>
<t:EventType>ModifiedEvent</t:EventType>
<t:EventType>MovedEvent</t:EventType>
<t:EventType>NewMailEvent</t:EventType>
<t:EventType>FreeBusyChangedEvent</t:EventType>
</t:EventTypes>
<t:Watermark />
<t:Timeout>1</t:Timeout>
</m:PullSubscriptionRequest>
</m:Subscribe>
</s:Body>
</s:Envelope>
However this will always return an ErrorInternalServerError with text An internal server error occurred. The operation failed. and no faultactor. I've tried this with and without the superfluous <t:FolderIds /> and <t:Watermark/> tags. With different timeouts and different contents of <t:EventTypes>.
But when I remove the SubscribeToAllFolders="" and add in the folders manually like:
<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<s:Header>
<t:RequestServerVersion Version="Exchange2013_SP1" />
</s:Header>
<s:Body>
<m:Subscribe>
<m:PullSubscriptionRequest>
<t:FolderIds>
<t:DistinguishedFolderId Id="inbox" />
</t:FolderIds>
<t:EventTypes>
<t:EventType>CopiedEvent</t:EventType>
<t:EventType>CreatedEvent</t:EventType>
<t:EventType>DeletedEvent</t:EventType>
<t:EventType>ModifiedEvent</t:EventType>
<t:EventType>MovedEvent</t:EventType>
<t:EventType>NewMailEvent</t:EventType>
<t:EventType>FreeBusyChangedEvent</t:EventType>
</t:EventTypes>
<t:Watermark />
<t:Timeout>10</t:Timeout>
</m:PullSubscriptionRequest>
</m:Subscribe>
</s:Body>
</s:Envelope>
I get the expected response.
Anyone had any problems with SubscribeToAllFolders before? Is there a way to get it working? I'm relatively new to EWS and SOAP so am I doing anything definitively stupid up my end? Thanks for any help.
Your request isn't formatted correctly eg it should look like
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<t:RequestServerVersion Version="Exchange2013_SP1" />
</soap:Header>
<soap:Body>
<m:Subscribe>
<m:PullSubscriptionRequest SubscribeToAllFolders="true">
<t:EventTypes>
<t:EventType>CopiedEvent</t:EventType>
<t:EventType>CreatedEvent</t:EventType>
<t:EventType>DeletedEvent</t:EventType>
<t:EventType>ModifiedEvent</t:EventType>
<t:EventType>MovedEvent</t:EventType>
<t:EventType>NewMailEvent</t:EventType>
</t:EventTypes>
<t:Timeout>5</t:Timeout>
</m:PullSubscriptionRequest>
</m:Subscribe>
</soap:Body>
</soap:Envelope>
I'd suggest you look at using the EWSEditor https://ewseditor.codeplex.com/ to do some testing it will both let you test the operation and give you the SOAP used for each request and response.