XML/URL Field encoding when using UpdateListItems web service - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

XML/URL Field encoding when using UpdateListItems web service

Last post 11-02-2011 01:37 PM by Jimmy. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 09-21-2011 11:24 AM

    XML/URL Field encoding when using UpdateListItems web service

    I'm trying to use UpdateListItems in the easiest possible way and it is painfully not working. I've narrowed it down to the fact that the xml I am building is being URL encoded while being passed to the web service data connection.

    I have a field called tmp_UpdateXML which I created with the value:

     concat("<Batch OnError='Continue' ListVersion='1' ViewName='All Items'><Method ID='1' Cmd='New'><Field Name='ID'>New</Field><Field Name='Title'>", Filename, "</Field></Method></Batch>")

    (Filename is actually an "inserted field")

    I tried it as an XHTML field, a text field, a complex type, and in the data connection I have chosen to send the parameter as a string and another not as a string. But I always get the error:

     <?xml version="1.0" encoding="utf-8"?><SOAP-ENV:Envelope xmlns:SOAPSDK1="http://www.w3.org/2001/XMLSchema" xmlns:SOAPSDK2="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAPSDK3="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><tns:UpdateListItems xmlns:tns="Voucher'>http://schemas.microsoft.com/sharepoint/soap/"><tns:listName>Voucher Numbering</tns:listName><tns:updates><my:tmp_UpdateXML xmlns:my="&lt;Batch'>http://schemas.microsoft.com/office/infopath/2003/myXSD/2011-06-08T19:21:38">&lt;Batch OnError='Continue' ListVersion='1' ViewName='All Items'&gt;&lt;Method ID='1' Cmd='New'&gt;&lt;Field Name='ID'&gt;New&lt;/Field&gt;&lt;Field Name='Title'&gt;74478b53-d337-459f-b5eb-d38e9e978a65&lt;/Field&gt;&lt;/Method&gt;&lt;/Batch&gt;......

    Obviously it is encoding the values.. Any way to make this madness stop? I am so used to easily doing this with Nintex, this is driving me crazy. I've read other solutions about creating repeating tables, etc, but I don't want anything visible and I'm just posting one value. It seems that every post I have found is a copy and paste or someone's elses that all talks about the repeating table approach to dynamically creating CAML, etc, but nothing that addresses trying to create this XML by hand or dynamically.

     Help?

  • 11-02-2011 01:37 PM In reply to

    Re: XML/URL Field encoding when using UpdateListItems web service

    Well, if you're building up the XML with a concat() statement, that's going to be treated as a string value no matter what settings you choose.  I think you may be out of luck with that approach.

    Are you always going to be using the same structure when calling this method (i.e.  always one <Method> node and two <Field> nodes)?  If so, you can create a secondary XML data source with that structure, set up the data connection to submit that as XML, and use rules to modify the individual values before submit.  If you're looking at a few different possible configurations of Method/Field nodes, you could create one of each in your secondary XML data source, and create a different submit connection for each one.

     Anything more complex than that, and I think you'll need to look at something code-based, either something you've written yourself, or something like qRules, that can add and delete XML nodes without you writing any actual code.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.