WebMethods Integration Server pub.client.soapclient changes the request element names - soap

I have an issue with build-in (non accessible) webMethods Integration Server soapClient service. Somehow it changes the request it should send while processing it, renaming parameter items to item.
what is send to the method:
<request>
<t1>1</t1>
<operation>op</operation>
<service>1</service>
<params>
<count>1</count>
<items>
<key>12</key>
<value>12</value>
</items>
</params>
</request>
what request webmethods sends:
<request>
<t1>1</t1>
<operation>op</operation>
<service>1</service>
<params>
<count>1</count>
<item>
<key>12</key>
<value>12</value>
</item>
</params>
</request>
I'd be grateful for any workaround/idea for a solution.

I see in your example code that you first create an document named "items", then you map this document to a document list named "items". This is not valid. Please note that the pipeline in IntegrationServer is nothing but a key-value map, and the keys must be unique. That is the reason why you still have a single document named "items" instead of a document list. Rename your document to something like "item", and then use appendToDocumentList to add it to the "items" doc list.

Related

How to use single_media_upload

I am looking for an example for simple use of single_media_upload in SULU AdminUI.
I have a player form, and it has single_media_selection type of field, and it works OK.
Now, how can I use single_media_upload, because, when I replace it instead of single_media_selection, it shows not picture in form after save (but it saves image).
<property name="photo" type="single_media_selection" colspan="4" >
<meta>
<title>playerinfo.playerimage</title>
</meta>
<params>
<param name="types" value="image"/>
</params>
</property>
I replace with
<property name="photo" type="single_media_upload" colspan="4" spaceAfter="2">
<params>
<param name="upload_text">
<meta>
<info_text>app.player_info_upload</info_text>
</meta>
</param>
<param name="skin" value="default"/>
<param name="empty_icon" value="su-user"/>
<param
name="collection_id"
type="expression"
value="service('sulu_media.system_collections.manager').getSystemCollection('sulu_media')"
/>
</params>
</property>
In Entity itself, field is MediaInterface type.
The single_media_upload field-type is not interchangeable with the single_media_selection type. It was implemented for managing the avatar/logo of the built-in contact/account entity and was not optimized for other usecases yet. At the moment, the single_media_upload creates a new media version for the selected media entity rather than creating a separate media entity when uploading a file. This behaviour differs substantially from the single_media_selection and might not fit your usecase. This is also the reason why the field-type is not listed in the Sulu documentation yet.
That said, the reason for your problem is likely that the single_media_upload field-type uses a different data format than the single_media_selection. In general, the field-types of the Sulu form view expect that your API returns the data in the same format as it is sent to the server when submitting the form (see the Form configuration section in the Sulu documentation). You can see the data that is sent to the server by inspecting the request that is made when pressing the save button in the network panel development tools of your browser.
In the case of the single_media_upload field-type, the data that is sent to the server looks like this:
{
"id": 33,
"url": "/media/33/download/photo-1535683939029-0030b4de2382.jpeg?v=1",
"thumbnails": {
"sulu-400x400": "/uploads/media/sulu-400x400/03/33-photo-1535683939029-0030b4de2382.jpg?v=1-0",
...
}
}
If you want to use the field-type in the form of your custom entity, you need to adjust your controller (or the serialization of your entity) to match this format.

Uploading of files using sap.m.UploadCollection in Openui5 with a backend servlet doesn't work

I have written a backend servlet to handle the upload of files using the instantUpload feature of sap.m.UploadCollection in Openui5. As I am uploading multiple files to the server, I have chosen the sap.m.UploadCollection instead of the sap.ui.unified.FileUploader. When I try to parse out a list of FileItem instances from the HttpServletRequest in the servlet, it gives me the exception
the request doesn't contain a multipart/form-data or multipart/mixed stream
The ServletFileUpload.isMultipartContent(request) is obviously returning me a false and confirms me that it isn't a multipart/form-data request.
XML Code:
<UploadCollection id="UploadCollection1"
multiple="true"
sameFilenameAllowed="true"
showSeparators="All"
change="onChangeUploadCollection"
fileDeleted="onFileDeleted"
selectionChange="onSelectionChange"
uploadComplete="onUploadCompleteUploadCollection"
beforeUploadStarts="onBeforeUploadStarts"
items="{path : '/record/uploadcollectionitems', templateShareable : 'true'}"
uploadUrl="{/record/upload}"
mode="SingleSelectLeft">
<toolbar>
<OverflowToolbar id="myId1">
<Title id="attachmentTitle1" />
<ToolbarSpacer />
<Button id="downloadButton1" text="Download" press="onDownloadItem"
enabled="false" type="Transparent"></Button>
</OverflowToolbar>
</toolbar>
<items>
<UploadCollectionItem documentId="{documentId}"
fileName="{fileName}" mimeType="{mimeType}"
url="{url}" enableEdit="true" enableDelete="true"
visibleDelete="true" visibleEdit="true"
statuses="{path : '/record/uploadcollectionitems', templateShareable : 'true'}"
selected="false">
<statuses>
<ObjectStatus title="{Status}" visible="false"
state="{state}" icon="{icon}" iconDensityAware="{iconDensityAware}"
textDirection="{textDirection}" />
</statuses>
</UploadCollectionItem>
</items>
</UploadCollection>
The uploadURL in the XML points to the Servlet, which starts executing after the selection of the file is done on the front-end.
If I choose to use the FileUploader instead of the UploadCollection, it successfully encodes the request as a multipart/form-data, but it does not fulfill my requirements.
I have also tried adding content-typeas a HeaderParameter and setting it to multipart/form-data, in order to make the request as a multipart/form-data. Since such a step is not advisable, I have aborted it mid-way.
Since the sap.m.UploadCollection control uses the sap.ui.unified.FileUploader control and contains dependencies to this control, it is confusing as to why the former would not send the HttpServletRequest as a multipart/form-data.
Note:
I have not included the corresponding JavaScript code or the Servlet
code for brevity purposes. I'll be happy to include them if required.
If you take closer look into the code you'll see that the FileUploader used by the UploadCollection is always instantiated with useMultipart set to false. You do not have chance to change that unless you intervene the creation of the FileUploader. I'm not sure why this approach has been taken.
You can use the UploadCollection with multipart.
In the controller, you need to have:
onBeforeUploadStarts: function(oEvent) {
var oUploadCollection = this.getView().byId("UploadCollection");
oUploadCollection = oUploadCollection._getFileUploader();
oUploadCollection.setUseMultipart(true);
}

Qlikview REST connector pagination namespaced XML

We have a XML file that is on somewebsite and looks in a way like this (confidential parts stripped)
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<feed xml:base="https://somewebsite.com/crm/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom">
<title type="text">Accounts</title>
<id></id>
<updated>2016-02-04T08:36:56Z</updated>
<link rel="self" title="Accounts" href="Accounts" />
<entry>
<title type="text"></title>
<updated>2016-02-04T08:36:56Z</updated>
<author>
<name />
</author>
<content type="application/xml">
<m:properties>
<d:Type>A</d:Type>
<d:UniqueTaxpayerReference m:null="true" />
<d:VATLiability m:null="true" />
<d:VATNumber m:null="true" />
<d:Website m:null="true" />
</m:properties>
</content>
</entry>
<link rel="next" href="https://somewebsite.com/Accounts?$skiptoken=guid'ee6bc390-a8ac-4bbd-8a4d-0a1f04ab9bd3'" />
</feed>
We use the new Rest connector to get the data out of this XML file.
The XML has pagination and every 60 entries you can load the next 60 with the link at the bottom of this xml file.
The problem i have is when, in the REST connector, we want to enable pagination with these setting:
Pagination Type: Next URL
Next URL field path:
/*[name()="feed"]/*[name()="link"][contains(#rel,"next")]/#href
It doesn't seem to work...
side note: the XML file has namespaces so i need to target the elements this way instead of /feed/link/...
I'm using Xpath syntax to target the link href, but maybe this is not the way to go? Or maybe the REST connector isn't using Xpath syntax?
Really hope someone can help me!
Actually it turns out that this seems to be due to a "bug" in the "Qlik REST Connector 1.0" so the pagination doesn't work.
But there is a fix for it:
1) Make sure that the Qlik REST Connector 1.0 connect dialog box has the NextUrl set to:
feed/link/attr:href
2) When the SQL has been generated after using the SELECT-button and going through the wizard you have to modify the sub-SELECT that reads like this:
.....
(SELECT
"attr:rel" AS "rel",
"attr:title" AS "title",
"attr:href" AS href,
"__FK_link"
FROM "link" FK "__FK_link"),
.....
On line 05 you will have to remove the text AS href.
So it should look like this:
.....
(SELECT
"attr:rel" AS "rel",
"attr:title" AS "title",
"attr:href",
"__FK_link"
FROM "link" FK "__FK_link"),
....
3) Find the LOAD statement that loads from this sub-select with a RESIDENT [MasterREST further down in the load script and make sure that the reference to href is changed to [attr:href] - or else you will get an error message while loading.
Should look like this after the change:
[link]:
LOAD [rel],
[title],
[attr:href],
[__FK_link] AS [__KEY_feed]
RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__FK_link]);
This worked for me:
/*[name()='feed']/*[name()='link'][#rel='next']/#href
Yours should also work actually, maybe whatever you are using does not agree with double quotes instead of single quotes.

what is the metadata attribute pair in MQFTE ? Why is it used?

I am working with wmqfte. While creating a transfer there is a parameter for metadata attribute pair. Why is this used for ?
One of the FTE engagements I worked on required email notifications of transfer status. Our approach to this was to add an email step in the transfer and the way we passed in the source and destination addresses was with metadata pairs. The transfer XML is provided below for an example:
<?xml version="1.0" encoding="UTF-8"?><request version="4.00" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FileTransfer.xsd">
<!DOCTYPE request>
<managedTransfer>
<originator>
<hostName>host.example.com</hostName>
<userID>me</userID>
</originator>
<sourceAgent QMgr="QMGR01" agent="AGENT01"/>
<destinationAgent QMgr="QMGR02" agent="AGENT02"/>
<transferSet priority="5">
<metaDataSet>
<metaData key="email.from">fteadmin#example.com</metaData>
<metaData key="email.to">"dept#example.com</metaData>
</metaDataSet>
<item checksumMethod="MD5" mode="binary">
<source disposition="delete" recursive="false">
<file>/root/path/file</file>
</source>
<destination exist="overwrite" type="directory">
<file>/root/path/</file>
</destination>
</item>
</transferSet>
<job>
<name>Your Job Name Here</name>
</job>
</managedTransfer>
</request>
A better way of sending status emails is to watch the transfer notifications published at the Coordination QMgr. However this example does show one possible use for the metadata pairs.

NSXMLParser and duplicate tags

I have a xml file. That I want to parse with NXXMLParser. I have a basic understanding of how to use NSXMLParser but ive reached this problem were the xml file is using duplicate tags for different reasons.
The xml file looks a little like this.
<member>
<name>billy</name>
<id>1</id>
</member>
<token>
<name>login token</name>
<id>1</id>
</token>
<member>
<name>bob</name>
<id>2</id>
</member>
<token>
<name>login token</name>
<id>2</id>
</token>
Now lets say I created created 4 arrays.
memberName
memberID
tokenName
tokenID
How can I extract the data and assign it to their respective array.
Just have a state variable as a member of the delegate - when you see a "member" tag start set the state to "member", when you see a "token" tag, set the state to "token".
Then when you see the "name" and "id" tag, check the state and add it to the right array.