How to send raw XML request in node-soap - node.js

I've read the documentation about sending RAW xml request here: https://www.npmjs.com/package/soap#example-with-xml-string-for-the-args
And there is a example at the mentioned documentation:
var args = { _xml: "<ns1:MyRootElement xmlns:ns1="http://www.example.com/v1/ns1">
<ChildElement>elementvalue</ChildElement>
</ns1:MyRootElement>"
};
I've did the same, and defined my args but I could not get org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 390; The content of elements must consist of well-formed character data or markup. error message from SOAP server
Here is my args definition:
let args = {
_xml: '<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://WSDLPROVIDER" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">'
+ '<SOAP-ENV:Body>'
+ '<ns1:enqueue>'
+ '<domain xsi:type="xsd:string">XXXXDOMAINXXXX</domain>'
+'<messageBodies SOAP-ENC:arrayType="xsd:string[1]" xsi:type="SOAP-ENC:Array">'
+ '<item xsi:type="xsd:string">Hello</item>'
+ '</messageBodies>'
+ '<recipientNumbers SOAP-ENC:arrayType="xsd:string[2]" xsi:type="SOAP-ENC:Array">'
+ '<item xsi:type="xsd:string">0936XXXX</item>'
+ '<item xsi:type="xsd:string">0918XXXX</item>'
+ '</recipientNumbers>'
+ '<senderNumbers SOAP-ENC:arrayType="xsd:string[1]" xsi:type="SOAP-ENC:Array">'
+ '<item xsi:type="xsd:string">3000XXX</item>'
+ '</senderNumbers>'
+ '<encodings xsi:nil="true" xsi:type="SOAP-ENC:Array" />'
+ '<udhs xsi:nil="true" xsi:type="SOAP-ENC:Array" />'
+ '<messageClasses xsi:nil="true" xsi:type="SOAP-ENC:Array" />'
+ '<priorities xsi:type="SOAP-ENC:Array" />'
+ '<checkingMessageIds SOAP-ENC:arrayType="xsd:long[2]" xsi:type="SOAP-ENC:Array">'
+ '<item xsi:type="xsd:long">102</item>'
+ '<item xsi:type="xsd:long">103</item>'
+ '</checkingMessageIds>'
+ '</ns1:enqueue>'
+ '</SOAP-ENV:Body>'
+ '</SOAP-ENV:Envelope>'
}
When I try to console.log(client.lastRequest) it will return this:
last request: <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:impl="http://magfa.com/soap/SOAPSmsQueue" xmlns:intf="http://magfa.com/soap/SOAPSmsQueue" xmlns:tns1="urn:SOAPSmsQueue" xmlns:ns1="http://magfa.com/soap/SOAPSmsQueue"><soap:Header></soap:Header><soap:Body><impl:enqueue>**<$value>**<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://WSDLPROVIDER" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:enqueue><domain xsi:type="xsd:string">XXXXXDOMAINXXXX</domain><messageBodies SOAP-ENC:arrayType="xsd:string[1]" xsi:type="SOAP-ENC:Array"><item xsi:type="xsd:string">Hello</item></messageBodies><recipientNumbers SOAP-ENC:arrayType="xsd:string[2]"
xsi:type="SOAP-ENC:Array"><item xsi:type="xsd:string">09367xxxx</item><item xsi:type="xsd:string">09189xxxx</item></recipientNumbers><senderNumbers SOAP-ENC:arrayType="xsd:string[1]" xsi:type="SOAP-ENC:Array"><item xsi:type="xsd:string">3000xxxx</item></senderNumbers><encodings xsi:nil="true" xsi:type="SOAP-ENC:Array" /><udhs xsi:nil="true" xsi:type="SOAP-ENC:Array" /><messageClasses xsi:nil="true" xsi:type="SOAP-ENC:Array" /><priorities xsi:type="SOAP-ENC:Array" /><checkingMessageIds SOAP-ENC:arrayType="xsd:long[2]" xsi:type="SOAP-ENC:Array"><item xsi:type="xsd:long">102</item><item xsi:type="xsd:long">103</item></checkingMessageIds></ns1:enqueue></SOAP-ENV:Body></SOAP-ENV:Envelope>**</$value>**</impl:enqueue></soap:Body></soap:Envelope>
Is there any way to send this

You can send raw XML using the $xml key:
let args = {
$xml: '<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://WSDLPROVIDER" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">'
+ '<SOAP-ENV:Body>'
+ '<ns1:enqueue>'
+ '<domain xsi:type="xsd:string">XXXXDOMAINXXXX</domain>'
+'<messageBodies SOAP-ENC:arrayType="xsd:string[1]" xsi:type="SOAP-ENC:Array">'
+ '<item xsi:type="xsd:string">Hello</item>'
+ '</messageBodies>'
+ '<recipientNumbers SOAP-ENC:arrayType="xsd:string[2]" xsi:type="SOAP-ENC:Array">'
+ '<item xsi:type="xsd:string">0936XXXX</item>'
+ '<item xsi:type="xsd:string">0918XXXX</item>'
+ '</recipientNumbers>'
+ '<senderNumbers SOAP-ENC:arrayType="xsd:string[1]" xsi:type="SOAP-ENC:Array">'
+ '<item xsi:type="xsd:string">3000XXX</item>'
+ '</senderNumbers>'
+ '<encodings xsi:nil="true" xsi:type="SOAP-ENC:Array" />'
+ '<udhs xsi:nil="true" xsi:type="SOAP-ENC:Array" />'
+ '<messageClasses xsi:nil="true" xsi:type="SOAP-ENC:Array" />'
+ '<priorities xsi:type="SOAP-ENC:Array" />'
+ '<checkingMessageIds SOAP-ENC:arrayType="xsd:long[2]" xsi:type="SOAP-ENC:Array">'
+ '<item xsi:type="xsd:long">102</item>'
+ '<item xsi:type="xsd:long">103</item>'
+ '</checkingMessageIds>'
+ '</ns1:enqueue>'
+ '</SOAP-ENV:Body>'
+ '</SOAP-ENV:Envelope>'
}
I've referenced this post
https://stackoverflow.com/a/42143198
as well as the node-soap code where it declares an XML key:
public xmlKey = '$xml';

Related

My SOAP post response is not returning 200 in Python, but it works in Postman

So I ran my post method for SOAP in Postman and received 200, the response headers had text/xml; charset=utf-8 for Content type. My Headers in Postman excluding the default values are
ClientID 700,
SOAPAction urn,
Content-Type text/xml
url = www.xyz.com.svc
The SOAP raw XML used to run in Postman.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.xsd" xmlns:wsu="http://docs.oa.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-1234">
<wsse:Username>E</wsse:Username>
<wsse:Password Type="http://docs.o-username-token-profile-1.0#PasswordText">abcd</wsse:Password>
<wsse:Nonce EncodingType="http://docs.o.security-1.0#Base64Binary">happy</wsse:Nonce>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
<ConfirmAppointment xmlns="urn:CompanyNameServices" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!--string occurs:0,1-->
<PatID xsi:nil="false">A1</PatID>
<!--string occurs:0,1-->
<PIDType xsi:nil="false">B</PIDType>
<!--string occurs:0,1-->
<MyCID xsi:nil="false">1</MyCID>
<!--string occurs:0,1-->
<MIDType xsi:nil="false">External</MyIDType>
<!--string occurs:0,1-->
<AppCID xsi:nil="false">1</AppCID>
</ConfirmAppointment>
</soapenv:Body>
</soapenv:Envelope>
I am trying to run this using Python requests.post, here is my code.
soap_body = '''
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.xsd" xmlns:wsu="http://docs.oa.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-1234">
<wsse:Username>E</wsse:Username>
<wsse:Password Type="http://docs.o-username-token-profile-1.0#PasswordText">abcd</wsse:Password>
<wsse:Nonce EncodingType="http://docs.o.security-1.0#Base64Binary">happy</wsse:Nonce>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
<ConfirmAppointment xmlns="urn:CompanyNameServices" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!--string occurs:0,1-->
<PatID xsi:nil="false">A1</PatID>
<!--string occurs:0,1-->
<PIDType xsi:nil="false">B</PIDType>
<!--string occurs:0,1-->
<MyCID xsi:nil="false">1</MyCID>
<!--string occurs:0,1-->
<MIDType xsi:nil="false">External</MyIDType>
<!--string occurs:0,1-->
<AppCID xsi:nil="false">1</AppCID>
</ConfirmAppointment>
</soapenv:Body>
</soapenv:Envelope>'''
headers = {
'ClientID': '700',
'SOAPAction': 'urn',
'Content-Type': 'text/xml'
}
response = requests.post(url=url, data=soap_body, headers=headers)
print(response)
My output:
<Response [500]>
If I add <?xml version="1.0" encoding="UTF-8"?> to the beginning of my body, my output:
<Response [400]>
What am I doing wrong here?
Here are 2 sample SOAP requests. See if they work for you.
import requests
url = "https://httpbin.org/post"
headers = {"content-type" : "application/soap+xml"}
body = """
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:req="https://httpbin.org/post">
<soapenv:Header/>
<soapenv:Body/>
</soapenv:Envelope>
""".strip()
response = requests.post(url, data = body, headers = headers)
print(response.content.decode("utf-8") +'\n')
###########################################
url = "https://www.dataaccess.com/webservicesserver/NumberConversion.wso"
headers = {"content-type" : "application/soap+xml"}
body = """
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<NumberToWords xmlns="http://www.dataaccess.com/webservicesserver/">
<ubiNum>500</ubiNum>
</NumberToWords>
</soap:Body>
</soap:Envelope>
""".strip()
response = requests.post(url, data = body, headers = headers)
print(response.content.decode("utf-8") +'\n')

how to make http request from xml soap?

I am implementing one of the payment gateway(Advance cash) in my application.Here is the link :
Adv documentaion
According to its documentation I have to made request for transaction. But the request mention in it in xml format.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:wsm="http://wsm.advcash/">
<soapenv:Header/>
<soapenv:Body>
<wsm:sendMoney>
<arg0>
<apiName>api_name</apiName>
<authenticationToken>token</authenticationToken>
<accountEmail>name#example.com</accountEmail>
</arg0>
<arg1>
<amount>1.00</amount>
<currency>USD</currency>
<email>name#example.com</email>
<note>Some note</note>
<savePaymentTemplate>false</savePaymentTemplate>
</arg1>
</wsm:sendMoney>
</soapenv:Body>
</soapenv:Envelope>
I think it is kind of soap request,I want to know how to request this and what are the parameters I have to send using my node js application using "request" npm module.Please help.
You should use node-soap package. There is a request option which override the request module.
I made a sample, take a look
service.ts:
const service = {
UserService: {
ServicePort: {
getUserById(args) {
const user = { id: args.id, name: faker.name.findName(), email: faker.internet.email() };
return user;
}
}
}
};
service.wsdl:
<definitions name="Service" targetNamespace="http://localhost:8001/get-started/service.wsdl"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://localhost:8001/get-started/service.wsdl"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<message name="GetUserByIdInput">
<part name="id" type="xsd:string"></part>
</message>
<message name="GetUserByIdOutput">
<part name="id" type="xsd:string"></part>
<part name="name" type="xsd:string"></part>
<part name="email" type="xsd:string"></part>
</message>
<portType name="ServicePortType">
<operation name="getUserById">
<input message="tns:GetUserByIdInput"/>
<output message="tns:GetUserByIdOutput"></output>
</operation>
</portType>
<binding name="ServiceSoapBinding" type="tns:ServicePortType">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="getUserById">
<soap:operation soapAction="getUserById"/>
<input message="tns:GetUserByIdInput">
<soap:body parts="id" use="literal"/>
</input>
<output message="tns:GetUserByIdOutput">
<soap:body parts="id" use="literal"/>
<soap:body parts="name" use="literal"/>
<soap:body parts="email" use="literal"/>
</output>
</operation>
</binding>
<service name="UserService">
<documentation>Get started service</documentation>
<port name="ServicePort" binding="tns:ServiceSoapBinding">
<soap:address location="http://localhost:8001/get-started"/>
</port>
</service>
</definitions>
request.xml:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tns="http://localhost:8001/get-started/service.wsdl">
<soap:Body>
<tns:getUserById>
<id>8104d3c3-de13-432f-b4a0-a62f84f6206a</id>
</tns:getUserById>
</soap:Body>
</soap:Envelope>
server.spec.ts:
it('should get correct result using http request and static xml', async (done: jest.DoneCallback) => {
const xml = fs.readFileSync(path.resolve(__dirname, './static-xml.xml'), 'utf8');
const uuid = '8104d3c3-de13-432f-b4a0-a62f84f6206a';
const options = {
url,
method: 'POST',
body: xml,
headers: {
'Content-Type': 'text/xml;charset=utf-8',
'Accept-Encoding': 'gzip,deflate',
'Content-Length': xml.length
}
};
const rawXml = await request(options);
parser.parseString(rawXml, (err, actualValue) => {
if (err) {
done(err);
}
console.log('actualValue: ', JSON.stringify(actualValue));
expect(actualValue['soap:Envelope']['soap:Body']['tns:getUserByIdResponse']['tns:id']).toBe(uuid);
done();
});
});
The result:
actualValue: {"soap:Envelope":{"$":{"xmlns:soap":"http://schemas.xmlsoap.org/soap/envelope/","xmlns:tns":"http://localhost:8001/get-started/service.wsdl"},"soap:Body":{"tns:getUserByIdResponse":{"tns:id":"bf0f6172-2f53-4b33-94c8-9ff9ed8fd431","tns:name":"Theo Leannon","tns:email":"Brent.Berge#hotmail.com"}}}}
Here is the demo: https://github.com/mrdulin/nodejs-soap/tree/master/src/get-started

SharePoint - SOAP Request To Web Services Returns List Of Operations

I have a VB script that is supposed to grab a specific list item from SharePoint 2013 via web services.
Relevant code:
Dim response, request, colItem, objItem
Dim fileSystem: Set fileSystem = CreateObject("Scripting.FileSystemObject")
request = "<?xml version='1.0' encoding='utf-8'?>" & _
"<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>" & _
" <soap:Body>" & _
" <GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'>" & _
" <listName>{FC3E18D6-33E5-4032-BE4B-F0F92F6F18BA}</listName>" + _
" <viewName>{2861DF9F-11F8-4E4B-A318-D4D37C1C5169}</viewName>" + _
" <query></query>" & _
" </GetListItems>" & _
" </soap:Body>" & _
"</soap:Envelope>"
http.open "POST", "http://<redacted>/_vti_bin/Lists.asmx", False
http.setRequestHeader "Content-Type", "text/xml; charset=utf-8"
http.setRequestHeader "Content-Length", Len(request)
http.setRequestHeader "SOAPAction", "http://schemas.microsoft.com/sharepoint/soap/GetListItems"
http.send request
However, it is just returning the same page that I see if I navigate directly to .../_vti_bin/Lists.asmx, which is the list of supported operations. If I click on "GetListItems", the example XML it provides looks like what I have in the VB script, except for a few parameters which I believe are optional:
POST /_vti_bin/Lists.asmx HTTP/1.1
Host: <redacted>
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://schemas.microsoft.com/sharepoint/soap/GetListItems"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetListItems xmlns="http://schemas.microsoft.com/sharepoint/soap/">
<listName>string</listName>
<viewName>string</viewName>
<query>string</query>
<viewFields>string</viewFields>
<rowLimit>string</rowLimit>
<queryOptions>string</queryOptions>
<webID>string</webID>
</GetListItems>
</soap:Body>
</soap:Envelope>
I have Googled around and been unable to find what I am doing wrong.
Thanks
Instead of GUID try using the regular names of the list and views for the listName and viewName XML elements.
<GetListItems xmlns="http://schemas.microsoft.com/sharepoint/soap/">
<listName>My List</listName>
<viewName>All Items</viewName>
</GetListItems>
Here's a sample code I used on my SP 2013 site with jQuery.
$.ajax({
type: "POST",
contentType: "text/xml; charset=utf-8",
url: "https://site/_vti_bin/Lists.asmx",
data: '<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <GetListItems xmlns="http://schemas.microsoft.com/sharepoint/soap/"> <listName>My Test Cases</listName> </GetListItems> </soap:Body> </soap:Envelope>',
dataType: "xml",
success: function (msg) {
console.log(msg);
},
error: function (data, status, error) {
console.log('error');
}
});

Active Sync Client Sync Message, status code 4 - ParseSyncKey - AirSyncPermanentException

I'm currently writing an active sync client and I've successfully managed to do a folder sync. I'm now attempting to sync the "Notes" folder (using the sync command) and it's giving me an error code 4, which Microsoft describes as "Protocol Error" -- I don't see anything wrong in the protocol that I'm sending, here is the sections from my log:
Folder sync RequestBody :
<?xml version="1.0" encoding="utf-8" ?>
<FolderSync xmlns="FolderHierarchy:">
<SyncKey>0</SyncKey>
</FolderSync>
FolderSync ResponseBody:
<?xml version="1.0" encoding="utf-8" ?>
<FolderSync xmlns="FolderHierarchy:">
<Status>1</Status>
<SyncKey>1</SyncKey>
<Changes>
<Count>12</Count>
<Add>
<ServerId>1</ServerId>
<ParentId>0</ParentId>
<DisplayName>Calendar</DisplayName>
<Type>8</Type>
</Add>
<Add>
<ServerId>2</ServerId>
<ParentId>0</ParentId>
<DisplayName>Contacts</DisplayName>
<Type>9</Type>
</Add>
<Add>
<ServerId>3</ServerId>
<ParentId>0</ParentId>
<DisplayName>Deleted Items</DisplayName>
<Type>4</Type>
</Add>
<Add>
<ServerId>4</ServerId>
<ParentId>0</ParentId>
<DisplayName>Drafts</DisplayName>
<Type>3</Type>
</Add>
<Add>
<ServerId>5</ServerId>
<ParentId>0</ParentId>
<DisplayName>Inbox</DisplayName>
<Type>2</Type>
</Add>
<Add>
<ServerId>6</ServerId>
<ParentId>0</ParentId>
<DisplayName>Journal</DisplayName>
<Type>11</Type>
</Add>
<Add>
<ServerId>7</ServerId>
<ParentId>0</ParentId>
<DisplayName>Junk E-Mail</DisplayName>
<Type>12</Type>
</Add>
<Add>
<ServerId>8</ServerId>
<ParentId>0</ParentId>
<DisplayName>Notes</DisplayName>
<Type>10</Type>
</Add>
<Add>
<ServerId>9</ServerId>
<ParentId>0</ParentId>
<DisplayName>Outbox</DisplayName>
<Type>6</Type>
</Add>
<Add>
<ServerId>10</ServerId>
<ParentId>0</ParentId>
<DisplayName>Sent Items</DisplayName>
<Type>5</Type>
</Add>
<Add>
<ServerId>11</ServerId>
<ParentId>0</ParentId>
<DisplayName>Tasks</DisplayName>
<Type>7</Type>
</Add>
<Add>
<ServerId>RI</ServerId>
<ParentId>0</ParentId>
<DisplayName>RecipientInfo</DisplayName>
<Type>19</Type>
</Add>
</Changes>
</FolderSync>
My Sync RequestBody :
<?xml version="1.0" encoding="utf-8" ?>
<Sync xmlns="AirSync:">
<Collections>
<Collection>
<SyncKey>0</SyncKey>
<CollectionId>8</CollectionId>
<DeletesAsMoves>1</DeletesAsMoves>
<GetChanges/>
</Collection>
</Collections>
</Sync>
Lists this exception:
SyncCommand_OnExecute_Exception :
Microsoft.Exchange.AirSync.AirSyncPermanentException
at Microsoft.Exchange.AirSync.SyncCommand.ParseSyncKey(SyncCollection collection)
at Microsoft.Exchange.AirSync.SyncCommand.SyncTheCollection(SyncCollection collection, Boolean createSubscription, Boolean tryNullSync)
at Microsoft.Exchange.AirSync.SyncCommand.OnExecute()
And provides the following ResponseBody :
<?xml version="1.0" encoding="utf-8" ?>
<Sync xmlns="AirSync:">
<Status>4</Status>
</Sync>
Any ideas why it is failing there? This is the first sync of the folder, so the SyncKey SHOULD be 0...
From http://msdn.microsoft.com/en-us/library/gg675447(v=exchg.80).aspx :
A Status element (section 2.2.3.162.16) value of 4 is returned if the GetChanges element is present and empty or set to 1 (TRUE) when the SyncKey element value is 0 (zero). No error is returned if the GetChanges element is absent or set to 0 (FALSE) when the SyncKey value is 0 (zero).
You have present and empty in your xml.
You only may set GetChanges to 1 or live it empty (which is by default = 1) in any consequential sync request, not in initial sync request.

Use runtime optimized Javascript

I have the same problem described here on the e-office blog , but in my case it also happens in IE9. When I manually do a refresh of the page, everything is working again. It looks like the JS aggregator tries to do something with the javascript files.
Does anyone found a solution for this?
This is the way I load my client javascript files. The 'xast.locationJS' variable is the location on the server where I the javascript files can be found.
<xp:this.resources>
<xp:script clientSide="true">
<xp:this.src><![CDATA[${javascript:return applicationScope.get("xast.serverUrl") +"/" +applicationScope.get("xast.locationJS") + "/jquery-1.5.1.min.js"}]]></xp:this.src>
</xp:script>
<xp:script clientSide="true">
<xp:this.src><![CDATA[${javascript:return applicationScope.get("xast.serverUrl") + "/" + applicationScope.get("xast.locationJS") + "/jquery.hoverIntent.minified.js"}]]></xp:this.src>
</xp:script>
<xp:script clientSide="true">
<xp:this.src><![CDATA[${javascript:return applicationScope.get("xast.serverUrl") + "/" + applicationScope.get("xast.locationJS") + "/jquery.tools.min.js"}]]></xp:this.src>
</xp:script>
<xp:script clientSide="true">
<xp:this.src><![CDATA[${javascript:return applicationScope.get("xast.serverUrl") + "/" + applicationScope.get("xast.locationJS") + "/jquery-ui-1.8.14.custom.min.js"}]]></xp:this.src>
</xp:script>
<xp:script clientSide="true">
<xp:this.src><![CDATA[#{javascript:return applicationScope.get("xast.serverUrl") + "/" + applicationScope.get("xast.locationJS") + "/C2C_dojo.tools.js"}]]></xp:this.src>
</xp:script>
<xp:script clientSide="true">
<xp:this.src><![CDATA[#{javascript:return applicationScope.get("xast.serverUrl") + "/" + applicationScope.get("xast.locationJS") + "/CommonXmlFunctions.js"}]]></xp:this.src>
</xp:script>
<xp:script clientSide="true">
<xp:this.src><![CDATA[#{javascript:return applicationScope.get("xast.serverUrl") + "/" + applicationScope.get("xast.locationJS") + "/C2C_WebCaseSuggest.js"}]]></xp:this.src>
</xp:script>
<xp:script clientSide="true">
<xp:this.src><![CDATA[${javascript:return applicationScope.get("xast.serverUrl") + "/" + applicationScope.get("xast.locationJS") + "/uncompressed/xpUtils.js"}]]></xp:this.src>
</xp:script>
</xp:this.resources>
It looks like the 'compute on page load' property was the problem. I think libraries that are computed on page load wil be automatically picked up by the JS aggregator, or something like that.

Resources