Change of Content-Type with Module MessageTransformBean
Hello,
I am looking at an efficient way of changing the content-type of a received message (e.g. from application/xml to text/xml) by using the module MessageTransformBean.
I know it would be possible with Java Mapping, but if possible I want to avoid that and use a standard module.
I was thinking of using the parameter Transform.ContentType, however the problem is that the parameter xml.conversionType
has to be set too. I do not want to change the message format from flat to XML but just want to change the content type.
Is there any way to achieve with this standard module (maybe by using a dummy value for the xml.conversionType parameter)?
Thank you for your input!
Hi,
If you are using the SOAP receiver adapter, you can change the content type by these configuration parameters:
Module Configuration Parameter HTTP Header Entry Example
XMBWS.XMLEncoding Content-Type charset iso-8859-1
XMBWS.TransferEncoding Content-Transfer-Encoding base64
without the need for an additional module in the chain.
Hope this helps.
Regards,
S. Gokhan Topcu
Similar Messages
-
I have a team site collection and I want to add a new App of type Issue Tracking list. so I did the following:-
From the site collection I created a new App of type issue tracking.
Then from the site collection I created a new Content type named “CustomIssue” which has its parent as “Issue” content type.
I went to the Issue tracking list and I changed the default content type from Issue , to the new “CustomeIssue” content type.
I open the site collection using SP designer and I created a new Create form for my Issue tracking list based on the "CustomIssue" content type and I select to have the Create form as the default form when creating an item.
Everything till this point worked well. But when I open the “customIssue” content type , and I re-order the columns and I hide some columns, this was not reflected inside the custom Create form …
although when using the default content type and the default create form you can control the order of the fields and to specify if certain fields hold be hidden inside the Create form.. so can anyone advice on this please?Hi,
According to your post, my understanding is that you lost the ability to order and hide site columns if i use custom content type with a custom Create Form.
I try to reproduce the issue, the result is the same as yours.
As a workaround, if I modify the custom content type form the site setting, and then change the NewForm as the default form, it will change the column orders.
However, if I use the new created form as the default form, it will remain the original orders.
I recommend that you modify the custom content type form the site setting, and then reset the NewForm as the default form.
The result is as below:
Best Regards,
Linda Li
Linda Li
TechNet Community Support
ok thanks for the explanation ,, but what if i want to change the order and hidde some fields in the future ,, do i have to chnage the defualt create form again ... -
Hi,
I have a requirement to read the External Content Type and storing the Data in a Session Variable. The Reading of the content from External Content Type with out creating a External List.
Please help I am trying to find the solution, but unable to do that.
Thanks,
PradeepHi,
Firstly an external content type designed to work with SharePoint list and there is no way to read apart from this.
If you are looking the solution out of the " Business Connectivity" then find that data source has been exposed through WCF and Web Service ?
So you can use REST API and CSOM to consume those data in SharePoint.
You can also leverage the ADO.NET option if the datasources based on MS technologies.
Murugesa Pandian| MCPD | MCTS |SharePoint 2010 -
Changing the Site URL of a Sharepoint site changes the content type order
Description
Changing the Site URL of a Sharepoint site changes the content type order of all lists that
* contain folder content types
* and have a custom content type order
* where a folder content type is the first content type in order.
Reproducible behaviour
1. Create a Team Site in Sharepoint
2. Create a Task List "Test" on the Team Site
3. Go to List Settings
4. The Content Type order is by default
a. Task
b. Summary Task
5. Change the Content Type Order to
a. Summary Task
b. Task
6. Go To Site Settings "Title, description and icon"
7. Change the Site Url
8. Go To List "Test" List Settings
9. The Content Type order now is
a. Task
b. Summary Task
10. Select "Change New button order and default content type"
11. Here, the Content Type order still is
a. Summary Task
b. Task
Is this a bug? Has anyone noticed this behaviour before?
Kind Regards,
JoachimHi Joachim,
You are not missing something or doing something wrong. i Hope :). This behavior is reproductible.
The granularity of change is better by Powershell. But by the interface is most user-friendly.
Maybe that's the reason of this behavior.
Gilles Martinez
Twitter
Blog
Please mark as helpful/answer if this resolved your post -
How to Create Custom Content Type with 100 site columns ?
Hi EveryOne,
i have one requirement to create custom conten types in sharepoint 2013 as follows.
1. Create a content type with 100 site columns ( in this 100 site columns includes 10 mms feilds and 10 lookup fields).
2.when we deploy the content type in other server if already the same content type existing in the server it should be upgrade the existing content type.
Please advise how do develop the solution ( using power shell script or visual studio with event receiver or xml file)
Regards,
SrinivasTry below:
http://www.mindfiresolutions.com/Add-Columns--Fields-Programmatically-to-a-SharePoint-List-282.php
using(SPSite
oSPsite = new SPSite("http://Web-URL"))
oSPsite.AllowUnsafeUpdates =
true;
using (SPWeb oSPWeb = oSPsite.OpenWeb())
oSPWeb.AllowUnsafeUpdates =
true;
/* get the SPList object by list name*/
SPList lst = oSPWeb.Lists["EmpList"];
/* create a Numeric field for EmpID */
SPFieldNumber fldEmpID = (SPFieldNumber)lst.Fields.CreateNewField(
SPFieldType.Number.ToString(),
"EmpID");
fldEmpID.Required =
true;
fldEmpID.DisplayFormat =
SPNumberFormatTypes.NoDecimal;
/* create a Text field for Name */
SPFieldText fldName = (SPFieldText)lst.Fields.CreateNewField(
SPFieldType.Text.ToString(),
"Name");
fldName.Required =
true;
fldName.MaxLength = 50;
/* create a Date field for Dob*/
SPFieldDateTime fldDob = (SPFieldDateTime)lst.Fields.CreateNewField(
SPFieldType.DateTime.ToString(),
"Dob");
fldDob.DisplayFormat =
SPDateTimeFieldFormatType.DateOnly;
/* create a Currency field for Salary */
SPFieldCurrency fldSal = (SPFieldCurrency)lst.Fields.CreateNewField(
SPFieldType.Currency.ToString(),
"Salary");
fldSal.Currency =
SPCurrencyFieldFormats.UnitedStates;
fldSal.DisplayFormat =
SPNumberFormatTypes.TwoDecimals;
/* add the new fields to the list */
lst.Fields.Add(fldEmpID);
lst.Fields.Add(fldName);
lst.Fields.Add(fldDob);
lst.Fields.Add(fldSal);
/* finally update list */
lst.Update();
oSPWeb.AllowUnsafeUpdates =
false;
oSPsite.AllowUnsafeUpdates =
false;
If this helped you resolve your issue, please mark it Answered -
Significance of associating content type with folder in repository
Hi All,
pls. tell me the significance of associating content type with the folder.
Thanks in advance....This ought to help:
http://dev2dev.bea.com/cs/user/blog?file=/blog/cindymc/archive/2007/04/portal_content_1.html -
SharePoint 2013 Custom Content Type with Site Column custom validations
Hello,
Can somebody please suggest me how I can create custom content type with site columns with custom validation to site columns programmatically?
Thanks,
Praveen Kumar PadmakaranHi,
From your description, my understanding is that you want to create content type with site column with validation.
You could create a site column, and add some validation to the site column. After you could create a custom content type, please add the site column with validation to the content type. Please refer
to this code below:
static void Main(string[] args)
// replace your url
using (SPSite site = new SPSite("http://sp/sites/sp2013"))
using (SPWeb web = site.OpenWeb())
//define the type of the field
SPFieldType type = SPFieldType.Number;
// create a site column
SPField field = CreateSiteColumn(web, "newTest", type, "");
// add custom formula for the field
SPFieldNumber fieldNumber = web.Fields.GetField("newTest") as SPFieldNumber;
fieldNumber.ValidationFormula = "=[newTest]>5";
fieldNumber.ValidationMessage = ">5";
fieldNumber.Update();
SPContentTypeId parentItemCTypeId = web.ContentTypes[0].Id;
// create custom content type
SPContentType contentType = CreateSiteContentType(web, "newContent", parentItemCTypeId, "Custom Content Types");
// add the site column to the content type
AddFieldToContentType(web, contentType, field);
// add fiedl to contenttype
public static void AddFieldToContentType(SPWeb web, SPContentType contentType, SPField field)
if (contentType == null) return;
if (contentType.Fields.ContainsField(field.Title)) return;
SPFieldLink fieldLink = new SPFieldLink(field);
contentType.FieldLinks.Add(fieldLink);
contentType.Update();
// create a custom content type
public static SPContentType CreateSiteContentType(SPWeb web, string contentTypeName,SPContentTypeId parentItemCTypeId, string group)
if (web.AvailableContentTypes[contentTypeName] == null)
SPContentType itemCType = web.AvailableContentTypes[parentItemCTypeId];
SPContentType contentType =
new SPContentType(itemCType, web.ContentTypes, contentTypeName) { Group = @group };
web.ContentTypes.Add(contentType);
contentType.Update();
return contentType;
return web.ContentTypes[contentTypeName];
// create a site column
public static SPField CreateSiteColumn(SPWeb web, string displayName,SPFieldType fieldType, string groupDescriptor)
if (!web.Fields.ContainsField(displayName))
string fieldName = web.Fields.Add(displayName, fieldType, false);
SPField field = web.Fields.GetFieldByInternalName(fieldName);
field.Group = groupDescriptor;
field.Update();
return field;
return web.Fields[displayName];
You could refer to these articles:
C# code to create Site Column, Content Type, and add fields to Content Type
http://spshare.blogspot.jp/2013/10/c-code-to-create-site-column-content.html
How to do custom validation for site column in SharePoint
http://www.c-sharpcorner.com/uploadfile/anavijai/how-to-do-custom-validation-for-site-column-in-sharepoint/
Best Regards,
Vincent Han
TechNet Community Support
Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
[email protected]. -
Content conversion Vs Module (MessageTransformBean) - help?
Hi All,
Scenario- File Sender, reading file (header,data,*,trailer)
when should we use standard content conversion, Module (MessageTransformBean) ?
I need to generate complex XML structure from flat-file records.
Source (using some key value to identify header/data/trailer)
header
data-record
data-record
trailer
Target (nested structe - not sure how to do nested part using content conversion)
<message_mt>
<record>
<header>
<key>
<info>
<key1/>
<key2/>
</info>
</header>
<partner>
<parvw/>
<par1/>
</partner>
<line-ite>
.. details ..
</line-item>
</record>
<message_mt>
I looked at all the logs related to this, how-to docs as well, no where mentioned how to create nested structures, most of them are flat structure
Can anyone advise me how to do this and when should i use content coversion, module and why?
Appreciate any help.
Thanks
Message was edited by: kumar p
Message was edited by: kumar pThe content conversion in file adapter and module 'MessageTransformBean' are similar. Therefore you use the module in file adapter only, when you want to write an adapter module which works on the plain text structure before the conversion. Mostly you use the 'MessageTransformBean' in other adapters like JMS- or Mail adapter, where no content conversion is possible by default.
The content conversion is not able to create a nested structure. You have to create a flat structure first, then create a nested structure with mapping.
Regards
Stefan -
How do I change the content-type in http header when using JAX-WS?
I need to change Content-Type in http Header. I am using JAX-WS to invoke web service call. Can someone tell me how to do it? Thanks a lot!
LabVIEW does so many wonderful things, but the inability to perform what should be a simple task, such as upgrade a RT chassis within a LV Project, bewilders me. This is going to cost me hours, I just know it...
Is there anything on the Idea Exchange for this?? A quick search shows nothing, so maybe I'll add an entry.
Thoric (CLA, CLED, CTD and LabVIEW Champion) -
Hi,
I'm new to SharePoint 2013 I want to be able to query a MSSQL database from a SharePoint App I have tried to create an External Content Type (ECT) which is produced from a MSSQL stored Procedure, this procedure has several parameters which are needed to
filter the data correctly. From here I want to produce an external list which I can then query from a c# SharePoint app. If I leave the filters in the ECT null then the list is of course empty or if enter a default values the results are limited
for the app to query so are no good.
I want to dynamically pass values to the ECT when querying from the app, is this not possible. Should I just be returning everything in an external list and then letting the query in the app filter the data, this seems inefficient?
Is this the best way to do this or should I be doing this differently?
Please can someone point me in the right direction.
ThanksHi Pandra801,
When you create a the external content type, please try to add a filter based on your select statement.
http://arsalkhatri.wordpress.com/2012/01/07/external-list-with-bcs-search-filters-finders/
Or, try to create a stored procedure based on your select statement, then create ECT using the SQL stored procedure.
A step by step guide in designing BCS entities by using a SQL stored procedure
http://blogs.msdn.com/b/sharepointdev/archive/2011/02/10/173-a-step-by-step-guide-in-designing-bcs-entities-by-using-a-sql-stored-procedure.aspx
I hope this helps.
Thanks,
Wendy
Wendy Li
TechNet Community Support -
Invalid Content-Type with SAAJ
I get the following exception when trying to send a SOAPMessage with an attachment. Sorry for the length of this post. Lots of info.
com.sun.xml.messaging.saaj.SOAPExceptionImpl: Invalid Content-Type:application/x-www-form-urlencoded. Is this an error m
essage instead of a SOAP response?
The HTTP request looks like the following, I abbreviated the attachment content.
POST /edlf/design/service/ManagerServices/import HTTP/1.1
Accept: text/xml
User-Agent: Java/1.5.0_10
Host: localhost:9080
Connection: keep-alive
Content-type: application/x-www-form-urlencoded
Content-Length: 17537
------=_Part_0_24087760.1169577467505
Content-Type: text/xml; charset=utf-8
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<ImportFileRequest>
<File name="test.dlf"/>
</ImportFileRequest>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
------=_Part_0_24087760.1169577467505
Content-Type: application/octet-stream
lMqAAMxQMQBQSwMEFAAAAAgAPFtWNrcaY4xxAQAANwYAADMAAABMaXZlRG9jcy9Db250ZW50L0N1
c3RvbWVyLzEvRG9jdW1lbnQvMS9QYWdlLzEvMS5iaW6VVL1OAzEMdig/LbQsLEggcV1ZbmGv1Lkj
ooIJJKoCC0J06MDAyIxY4QGYeYATj8LEgtQBCTawcUIck8sdn2QlduwvsePEAMAZyjrKPYoBxhrK
awOgBR47XYDPba/LuRHjO8at4niXsy0THPuLAAcr8AdfFjG71K9Qd7yEl3nmpANL3jp2uU5273fd
YwmBaf3UxEP6aH+qxEjow6VZn2fOSql5awRG6VRwF1wURToYwsI3d0fTSdY/n6YC/ochSsceU95/
WX66GgbC+3UcVGOSQ5x3sZHMQvVZtF9rM+zPeNqznr6lMnzU8JHQecW6IdbvdXgJrn6as+OUwenl
hBzI0LYbPeN4Ija9QHkETo7Wxig5BhU4zlmfp1/6N5Tc3hGVO2zPduBXDeIfCF0nciz0LOl3BBtg
------=_Part_0_24087760.1169577467505--
My code snippet for producing the above is:
BASE64Encoder encoder = new BASE64Encoder();
String encString = "";
encString = encoder.encode(content);
ByteArrayDataSource bds = new ByteArrayDataSource(encString, "application/octet-stream", fileName);
DataHandler dh = new DataHandler(bds);
URL url = new URL(serviceEndPt + "ManagerServices/import");
HttpURLConnection connection = (HttpURLConnection)url.openConnection();
connection.setDoOutput(true);
connection.setDoInput(true);
connection.setRequestMethod("POST");
connection.setRequestProperty("Accept", "text/xml");
OutputStream out = connection.getOutputStream();
MessageFactory mf = MessageFactory.newInstance();
SOAPMessage msg = mf.createMessage();
SOAPPart sp = msg.getSOAPPart();
SOAPEnvelope envelope = sp.getEnvelope();
SOAPBody body = envelope.getBody();
SOAPBodyElement root = body.addBodyElement(envelope.createName("ImportFileRequest"));
SOAPElement fileEl = root.addChildElement(envelope.createName("File"));
Name attName = envelope.createName("name");
fileEl.addAttribute(attName, fileName);
root.addChildElement(fileEl);
AttachmentPart ap = msg.createAttachmentPart();
ap.setDataHandler(dh);
msg.addAttachmentPart(ap);
msg.writeTo(out);The error does not seem to appears in WLS stack. Place a sniffer tool between your client and service to capture more info.
Jong -
New Content Type with RDL template
I'm building a new Project Server 2010 site template and one of the libraries that I want to provide will store the Status Reports for each Project.
I'm struggling with what seems like a simple concept.
Create a new Content Type that uses the status_report.RDL as it's template so that users can click on the 'New Document' button drop down in the ribbon and select 'Status Report' from a list of possible document templates and then the status report opens, they
add the required parameters, run the report and then 'Export' it as an Excel Sheet which they can store in the library as a point in time report of the projects status.
Am I asking too much or do I just need to decypher the way that SharePoint builds the URL for the report from the actual .RDL file that's stored in a library in order to enter it as the location of the content type template?
Thanks in advance.
N03L.I should add that I'm planning on having this content type stored in a Content Type Hub and published for use in another Site Collection.
-
Newbie: managing content types with metadata - inheritance
Hello all,
a newbie-question:
Is it possible to set up new contenttypes with a hierarchical structure ?
For instance: every contenttype should have a meta-datafield called TEST123.
Can we make a 'superclass' contenttype with above mentioned meta-datafield and every contenttype created 'under' the superclass should inherit this meta-datafield.
Is this possible ? Or should we create every new contenttype with metadata TEST123 seperately ?
Thanks in advance.In fact if you create a metadatafield TEST123, that field is available for every content type.
I think you need to look at profiling. A profile is a set of metadatafields. For example you create a set called Document. That set holds field like:
TEST123
Type
Title
Author
You could then create severall profiles using that set, including other sets. In fact you could see a profile as a composite of different sets. In ECM these sets are called rules. -
This is a variation on the issue mentioned in this
post
We are using SP 2010 Content Hub to manage our content types. On the content hub we've created a couple of exteranl lists, and then created some site columns as lookups against these lists. We then added the columns to one of our content types
and set it to publish.
After the publishing job executed, I tried adding the content type (which now appears on the subscriber sites) to one of the document libraries on one of the subscriber sites. When I did that it threw the following error:
Microsoft.SharePoint.WebControls.BusinessDataListConfigurationException: Id field is not set on the external data field
at Microsoft.SharePoint.SPBusinessDataField.CreateIdField(SPAddFieldOptions op)
at Microsoft.SharePoint.SPBusinessDataField.OnAdded(SPAddFieldOptions op)
at Microsoft.SharePoint.SPFieldCollection.AddFieldAsXmlInternal(String schemaXml, Boolean addToDefaultView, SPAddFieldOptions op, Boolean isMigration, Boolean fResetCTCol)
at Microsoft.SharePoint.SPContentType.ProvisionFieldOnList(SPField field, Boolean bRecurAllowed)
at Microsoft.SharePoint.SPContentType.ProvisionFieldsOnList()
at Microsoft.SharePoint.SPContentType.DeriveContentType(SPContentTypeCollection cts, SPContentType& ctNew)
at Microsoft.SharePoint.SPContentTypeCollection.AddContentTypeToList(SPContentType contentType)
at Microsoft.SharePoint.SPContentTypeCollection.AddContentType(SPContentType contentType, Boolean updateResourceFileProperty, Boolean checkName, Boolean setNextChildByte)
at Microsoft.SharePoint.SPContentTypeCollection.Add(SPContentType contentType)
at Microsoft.SharePoint.ApplicationPages.AddContentTypeToListPage.Update(Object o, EventArgs e)
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) b55297ed-717f-466d-8bdc-297b20344d3f
I checked the external content type configuration and it did specify an "id column". Anyone know if what I am attempting to do is possible and if so, what special configurations are required?
ThanksThe issue is not External Content type or external list but the look up column.
It's not possible to publish a look up column via the Content Type Hub.
If you need to do this then an alternate way is to use a Managed Metadata column instead, otherwise you will have to implement this via a feature.
Varun Malhotra
=================
If my post solves your problem could you mark the post as Answered or Vote As Helpful if my post has been helpful for you. -
External content type with web service - new read item operation disable
Hi,
i'm tring to create an external content type based on web service.
I add for test the web service:
http://www.webservicex.net/globalweather.asmx?WSDL
when i try to set get reat item operation- it's disabled.
what should i do in order to create the operations?
keren tsurHi,
Please Provide screenshot about your issue.
For more information about how to create an external content type based on a web service:
http://msdn.microsoft.com/en-us/library/office/ee556431(v=office.14).aspx
besides, here are two posts about defining read operation on External content type error, you can take a look at:
https://social.technet.microsoft.com/Forums/en-US/f86a8f37-7c8c-4cf0-8722-c6d44aa1e3d8/defining-read-operation-on-external-content-type?forum=sharepointadmin
https://social.msdn.microsoft.com/Forums/sharepoint/en-US/4bcc1cd9-a9d6-4171-87d9-c6749543749c/bcs-connecting-to-a-list-in-another-site-collection-using-the-wcf-service?forum=sharepointcustomizationprevious
Best Regards,
Lisa Chen
Lisa Chen
TechNet Community Support
Maybe you are looking for
-
Problem with combo in js IE - new Option(t,v) not working
hello! Did somene had experience some problems with adding new options in select object (combo box) in javascript? I can change text or value property, delete option by setting it to null, but when I want to add new, there is a problem!? why this cod
-
Outlook 2013 Continually Prompting For Credentials
After migrating to Office 365 & installing Pro Plus 2013, Outlook 2013 (32-bit) continues to prompt for credentials even though it shows the mailbox as connected to Exchange. To stop this prompt, I've done the following: Removed Outlook credentials f
-
Some columns missing from spool
Hi All, we have one Z- program, that wil create spool out put, but 2 cloumns are missing from spool out put, how can we increase the size of the spool ouput? Regards, Suresh.D
-
Blackberry App World stuck in background
Hello, I have a BB 9780, OS 6 and I've updated App World to version 3.1.4.25. After doing this Blackberry App World stuck in background. I've tried everything deleting and re installing but nothing happens. I need help!!
-
HP Officejet 6500 Wireless will not print black but will color
I did the soak & had a lot of build up & put it back in machine it still with not print anything black. I've tried copying a form still no luck, I tried a hard shut down to reboot its self still nothing. What else could it be? or what else could I tr