# Custom Scripting Service XML Notifier Invalid XML Payload Error

**URL:** <https://community.dreamfactory.com/t/custom-scripting-service-xml-notifier-invalid-xml-payload-error/2126>\
**Category:** Server-Side Scripting\
**Created:** [February 3, 2016, 3:12pm UTC](https://community.dreamfactory.com/t/custom-scripting-service-xml-notifier-invalid-xml-payload-error/2126 "2016-02-03T15:12:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mharvey](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/mharvey/32/590_2.png) [@mharvey](https://community.dreamfactory.com/u/mharvey)\
**Post date:** [February 3, 2016, 3:12pm UTC](https://community.dreamfactory.com/t/custom-scripting-service-xml-notifier-invalid-xml-payload-error/2126/1 "2016-02-03T15:12:00Z")

</div>

I am writing a CSS Notifier service in PHP to receive XML notification data. I have managed to get the authentication working, but the XML Payload (sent as POST Body) is bombing with the error “ **Invalid XML Payload Supplied** ”.

The XML Data being sent looks like this:  
`<?xml version="1.0" encoding="UTF-8"?> <submission-notification> <form> <id type="integer">1</id> <name>FORM_NAME</name> <guid>FORM_GUID</guid> </form> <submission> <guid>SUBMISSION_GUID</guid> </submission> </submission-notification>`

Im using SimpleXML to read in the payload data:

```
	curl -i -k -3 -X POST https://relay.wastestrategies.com/rest/user/session 
	 -H "X-DreamFactory-Application-Name: canvasnotifier" 
	 -d "{ \"email\" : \"user@example.com\", \"password\" : \"Password\" }"

	$dataPOST = trim(file_get_contents("php://input"));
	$xmlData = simplexml_load_string($dataPOST);

	$notification = new SimpleXMLElement($xmlData);

	if(!isset( $notification->submission[0]->guid )){
		http_response_code(406);
	]; return [
	        "success" => false,
	        "message" => "Missing submission GUID in params"
	    ];
	}

	$submission_guid = $notification->submission[0]->guid;
	http_response_code(200);
	return [
	    "success" => true,
	    "result" => $submission_guid
	];

```

Any ideas why the payload would be invalid?

---

<div class="post-metadata">

**Author:** ![mharvey](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/mharvey/32/590_2.png) [@mharvey](https://community.dreamfactory.com/u/mharvey)\
**Post date:** [February 10, 2016, 7:50pm UTC](https://community.dreamfactory.com/t/custom-scripting-service-xml-notifier-invalid-xml-payload-error/2126/2 "2016-02-10T19:50:14Z")

</div>

FYI, After some troubleshooting by the engineer it seems the xml payload needs to be wrapped in tag for the type caster not to choke on the content. There is a request going in to allow the content through if the tag is missing and allow for the xml data to processed.

I’m interested if anyone has run into this before consuming 3rd party api xml data.

---

<div class="post-metadata">

**Author:** ![Mike\_Harvey](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/mike_harvey/32/572_2.png) [@Mike\_Harvey](https://community.dreamfactory.com/u/Mike_Harvey)\
**Post date:** [February 19, 2016, 10:19pm UTC](https://community.dreamfactory.com/t/custom-scripting-service-xml-notifier-invalid-xml-payload-error/2126/3 "2016-02-19T22:19:54Z")

</div>

Any update on this? This wrapper requirement is killing me.

---

<div class="post-metadata">

**Author:** ![benbusse](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/benbusse/32/4_2.png) [@benbusse](https://community.dreamfactory.com/u/benbusse)\
**Post date:** [February 20, 2016, 12:29am UTC](https://community.dreamfactory.com/t/custom-scripting-service-xml-notifier-invalid-xml-payload-error/2126/4 "2016-02-20T00:29:26Z")

</div>

Looking into it, will have an answer for you Monday.

---

<div class="post-metadata">

**Author:** ![formerstaff](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/formerstaff/32/1133_2.png) [@formerstaff](https://community.dreamfactory.com/u/formerstaff)\
**Post date:** [March 2, 2016, 6:24pm UTC](https://community.dreamfactory.com/t/custom-scripting-service-xml-notifier-invalid-xml-payload-error/2126/5 "2016-03-02T18:24:31Z")

</div>

For anybody reading this after the fact, this fix is in the release coming out later this month, and is already in the develop branch of df-core.

---

<div class="post-metadata">

**Author:** ![jigarunjha](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/jigarunjha/32/850_2.png) [@jigarunjha](https://community.dreamfactory.com/u/jigarunjha)\
**Post date:** [October 6, 2016, 3:00pm UTC](https://community.dreamfactory.com/t/custom-scripting-service-xml-notifier-invalid-xml-payload-error/2126/6 "2016-10-06T15:00:39Z")

</div>

I am also having the same problem while testing the service in Canvas Notification API , i am getting Response Code 500

I am using Spring Rest to receive call and it comsumes=“application/xml”

Can any body solve this problem
