Please login or register to access secure site features.

Note: By continuing to use DevConnect Program Services you agree to our latest Registered Member Terms.

Sign in using DevConnect ID

Forgot password?

Trouble logging in?

Submit a ticket for Registration Support.

I have an SSO ID

?
sign in

Don't have a DevConnect or SSO ID ?

Create a DevConnect account or join the program.

register now
^
New DevConnect members must have forum permissions in order to post messages.
If the Reply and New Post buttons are not available to you, please request access using a General Support request ticket.
Forum Index » Avaya Orchestration Designer » REST - Error: Content is not allowed in prolog   XML
 
Author Message
JNemani



Joined: 06/04/2017 10:03:12
Messages: 43
Offline

Hi,
I'm attempting my first REST connection in OD 8.0.0.2201. I'm using this endpoint provided to me

https://ea-mule-dev.corpadds.com/cea-ivr-sfdc-ivrprocess/v1/authenticate

with this json body

{
"IVRBranchId": "123",
"IVRPayrollId": "45670",
"IVRPin": "4321"
}

I first set this up in SoapUI and I get back the proper response shown here so I know the endpoint and body are accurate.

{
"result": "Success",
"message": "AuthenticationResponse",
"info": {
"Season": {"PayrollSeason": "RegularSeason"},
"Account": {
"Status": "Active",
"Platform": "Blue"
}
}
}

When I try to use that same endpoint and same Message Body values in the Web Service Operation Editor I get "Error: Content is not allowed in prolog."

Any ideas?

Thanks
[Thumb - AvayaRestIssue.JPG]
 Filename AvayaRestIssue.JPG [Disk] Download
 Description No description given
 Filesize 107 Kbytes
 Downloaded:  677 time(s)

WilsonYu



Joined: 06/11/2013 14:29:24
Messages: 3878
Offline

You will need the attached patch to resolve this issue.
 Filename ws08.00.22.01.p1.zip [Disk] Download
 Description No description given
 Filesize 36 Kbytes
 Downloaded:  434 time(s)

JNemani



Joined: 06/04/2017 10:03:12
Messages: 43
Offline

I gave that a shot.

I'm still getting the same error after applying the new jar and completely restarting.
"Error: Content is not allowed in prolog"

I'm getting the message when trying to save the WS file, not during the export of the application, if that makes a difference.
[Thumb - AvayaRestIssue2.JPG]
 Filename AvayaRestIssue2.JPG [Disk] Download
 Description No description given
 Filesize 150 Kbytes
 Downloaded:  624 time(s)

WilsonYu



Joined: 06/11/2013 14:29:24
Messages: 3878
Offline

Check under the project's WEB-INF/lib to see of the jar file has been updated.
WilsonYu



Joined: 06/11/2013 14:29:24
Messages: 3878
Offline

One more thing, the message body needs to start with "JSON":

JSON{
"x":"y"
}
JNemani



Joined: 06/04/2017 10:03:12
Messages: 43
Offline

Thank you so much it was the missing JSON before the body that solved the issue.
JNemani



Joined: 06/04/2017 10:03:12
Messages: 43
Offline

Still having an issue with the web service connector.

I have restResults configured as a simple variable you can see in the log that it shows Store [] to restResults, it's always empty despite the web service reply responding properly.

I've attached a screenshot of the Output Parameters section from my restNew.rest file if that helps.

23/03/2021 11:13:32:212 DEBUG - 8FD2DEE3314F590EE419D8681AB4A2D6:/Sandbox : Web Service Request -> https://ea-mule-dev.corpadds.com/cea-ivr-sfdc-ivrprocess/v1/authenticate
23/03/2021 11:13:35:037 INFO - 8FD2DEE3314F590EE419D8681AB4A2D6:/Sandbox : variable reference is simple true
23/03/2021 11:13:35:037 INFO - 8FD2DEE3314F590EE419D8681AB4A2D6:/Sandbox : return data is a collection false
23/03/2021 11:13:35:039 DEBUG - 8FD2DEE3314F590EE419D8681AB4A2D6:/Sandbox : Storing [] to: restResults
23/03/2021 11:13:35:040 DEBUG - 8FD2DEE3314F590EE419D8681AB4A2D6:/Sandbox : Web Service Reply <- {"result":"Success","message":"AuthenticationResponse","info":{"Season":{"PayrollSeason":"RegularSeason"},"Account":{"Status":"Active","Platform":"Blue"}}}
23/03/2021 11:13:35:041 INFO - 8FD2DEE3314F590EE419D8681AB4A2D6:/Sandbox : Using SCESession


Here I kick off a servlet to parse the json response but it is always blank.
8FD2DEE3314F590EE419D8681AB4A2D6:/Sandbox servlet : ParseJson

JSONObject json = new JSONObject(mySession.getVariableField(IProjectVariables.REST_RESULTS).getObjectValue());


[Thumb - AvayaRestIssue3.JPG]
 Filename AvayaRestIssue3.JPG [Disk] Download
 Description No description given
 Filesize 33 Kbytes
 Downloaded:  649 time(s)

WilsonYu



Joined: 06/11/2013 14:29:24
Messages: 3878
Offline

Try changing the Output Format to either JSON or String.
JNemani



Joined: 06/04/2017 10:03:12
Messages: 43
Offline

Hi Wilson,
Still having an issue with receiving the complete REST reply to a simple variable.

02/04/2021 16:39:08:406 INFO - FD7C3C3BF7A1DDB8F0D8AB15099AFB71:/Sandbox : Using SCESession FD7C3C3BF7A1DDB8F0D8AB15099AFB71:/Sandbox servlet : untitledData1
02/04/2021 16:39:08:488 INFO - FD7C3C3BF7A1DDB8F0D8AB15099AFB71:/Sandbox : Starting REST web service operation [restNewString]
02/04/2021 16:39:08:722 INFO - FD7C3C3BF7A1DDB8F0D8AB15099AFB71:/Sandbox : Using No Authentication for web service call, keystore : file:/ on port : 443
02/04/2021 16:39:08:726 DEBUG - FD7C3C3BF7A1DDB8F0D8AB15099AFB71:/Sandbox : Web Service Request -> https://ea-mule-dev.corpadds.com/cea-ivr-sfdc-ivrprocess/v1/authenticate
02/04/2021 16:39:10:178 INFO - FD7C3C3BF7A1DDB8F0D8AB15099AFB71:/Sandbox : variable reference is simple true
02/04/2021 16:39:10:178 INFO - FD7C3C3BF7A1DDB8F0D8AB15099AFB71:/Sandbox : return data is a collection false
02/04/2021 16:39:10:180 DEBUG - FD7C3C3BF7A1DDB8F0D8AB15099AFB71:/Sandbox : Storing [Failure] to: result
02/04/2021 16:39:10:180 DEBUG - FD7C3C3BF7A1DDB8F0D8AB15099AFB71:/Sandbox : Web Service Reply <- {"result":"Failure","message":"Authentication : PIN entered does not match the existing PIN in the system","info":{}}
02/04/2021 16:39:10:181 INFO - FD7C3C3BF7A1DDB8F0D8AB15099AFB71:/Sandbox : Using SCESession FD7C3C3BF7A1DDB8F0D8AB15099AFB71:/Sandbox servlet : ParseJson

You can see that the Web Service Reply is perfect, but the result (simple var) only contains the word "Failure", i need to contain the full JSON response {"result":"Failure","message":"Authentication : PIN entered does not match the existing PIN in the system","info":{}}

I've changed the output to JSON and get the same results, new screenshot attached.

[Thumb - Rest Issue.JPG]
 Filename Rest Issue.JPG [Disk] Download
 Description No description given
 Filesize 31 Kbytes
 Downloaded:  587 time(s)

JNemani



Joined: 06/04/2017 10:03:12
Messages: 43
Offline

ps. I know how to parse the object in java IF I could get the full reply as a json object into the simple variable. Thanks
WilsonYu



Joined: 06/11/2013 14:29:24
Messages: 3878
Offline

Try to change the parameter name to "(ALL)" instead of "result".
"(ALL)" was the default.
JNemani



Joined: 06/04/2017 10:03:12
Messages: 43
Offline

This worked perfectly, I can't thank you enough.....thanks
JaydeepH



Joined: 24/02/2017 04:50:54
Messages: 36
Offline

Hello,

I am currently using AOD 7.2.1, Java 8, Tomcat 8.5.43 versions.

I am looking for a REST API sample java code trying to hit a https url.

Appreciate if you can please share it,

Thanks for your support.

Warm regards,
Jaydeep Hatekar
WilsonYu



Joined: 06/11/2013 14:29:24
Messages: 3878
Offline

Would the OD REST connector not work? Otherwise, there is so much you can find by just googling.
JaydeepH



Joined: 24/02/2017 04:50:54
Messages: 36
Offline

Hi Wilson,

I did not use the in-built RESTful service within AOD. I did manage to develop the customized java code to hit a webservice via https url involving proxy.

Thanks for your support.

Warm regards,
Jaydeep Hatekar
 
 
Go to: