Legacy Dev Forum Posts

 View Only

Sign Up

Web Service Data Action Problem

  • 1.  Web Service Data Action Problem

    Posted 06-05-2025 18:40

    masanchezmemo | 2018-02-05 16:02:05 UTC | #1

    Hello there,

    I created a web service in C# and I'm getting this error once I test it under creata an action:

    { "status": 400, "code": "bad.request", "message": "The request could not be understood by the server due to malformed syntax.", "messageParams": {}, "contextId": "66317d7e-b1ab-4c63-90cb-007f73235120", "details": [], "errors": [] }

    Here is my input contract:

    { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "required": [ "encuestaOpcion" ], "properties": { "encuestaOpcion": { "type": "string" } } }

    And my output:

    { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "required": [ "resultado" ], "properties": { "resultado": { "type": "string" } } }

    And finally here it is my configuration:

    { "requestUrlTemplate": "127.0.0.1/Encuesta/WebServiceEncuesta/SetEncuesta?encuestaOpcion.aspx", "requestType": "POST", "headers": { "Content-Type": "application/json" }, "requestTemplate": "${input.rawRequest}" }

    I know it is something related to syntax, please any advice?

    Best regards,

    Mario


    masanchezmemo | 2018-02-06 00:12:39 UTC | #2

    Please I need your advise in order to move forward with my project.

    Tks,

    Mario


    anon43424206 | 2018-02-06 14:06:46 UTC | #3

    Hi Mario,

    Are you getting an error while creating the action or while invoking it? If it's on the invoke, can you include the payload being sent?

    Thanks! Eric


    masanchezmemo | 2018-02-06 14:22:21 UTC | #4

    Eric,

    Thanks!!! The error message is while creating the action and testing it.

    Rgds,

    Mario


    anon43424206 | 2018-02-06 14:32:01 UTC | #5

    If you get an error creating the action, you wouldn't be able to test it... Can you be more specific about the sequence of steps to reproduce the error?


    anon28066628 | 2018-02-06 14:52:37 UTC | #6

    Hi Mario, your problem is here -> 127.0.0.1

    This is a cloud-to-cloud service; the REST call is initiated from the AWS cloud, not your local machine. You won't be able to reach a local service with a PureCloud Data Action. You'd have to configure a webservice with a publicly-facing IP.

    Alternatively you can use he PureCloud Bridge Server and configure the webservices data dip connector. It specifically will connect to local services, so long as they're accessible from the Bridge server on your network. The configuration options for the Bridge connector are more limited though - only the input and output contracts are configurable. Therefore, your local webservice must accept very simple, "flat" JSON objects as request payloads and also return flattenable response payloads.


    masanchezmemo | 2018-02-06 15:10:09 UTC | #7

    Hey Smith thanks a lot. I'm using BRIDGE Server to connect to my local web services and that's why I use the 127.0.0.1 since the Bridge Server acts as IIS server too. So is that ok to keep using that way?

    Tks,

    Mario


    masanchezmemo | 2018-02-06 15:15:17 UTC | #8

    Eric,

    Once I configure the Integration using the Web Service Data Action I create a new integration action where I give it a name, setup the contract (input and output) then I try to setup the action configuration (request and response) and trying to run the test action is where I have the error.

    Tks,

    Mario


    anon28066628 | 2018-02-06 15:31:15 UTC | #9

    Yep, the bridge setup seems fine to me. However, you're configuring Data Actions -- I can tell because you have a "config" with the requestUrlTemplate, etc., and the webservices data dip bridge connector doesn't have that. You need to create a Bridge action for the webservices data dip connector, not a webservices data action.

    Try these references:

    https://help.mypurecloud.com/articles/about-web-services-data-dip-connector/

    https://help.mypurecloud.com/articles/add-bridge-action-web-services-data-dip-connector/


    masanchezmemo | 2018-02-06 16:01:29 UTC | #10

    Smith,

    Two questions, 1) How do I activate the Web Service Data Dip Bridge Connector? 2) What is exactly the difference between them?

    Tks,

    Mario


    anon28066628 | 2018-02-06 16:23:21 UTC | #11

    Hi Mario,

    Please contact support to request the webservices data dip bridge connector to be enabled for your org.


    masanchezmemo | 2018-02-06 22:21:09 UTC | #12

    Smith, finally support activated the DIP Connector. Now I'm having other issues like:

    Where do I setup my WebService methods? What is the url format I need to use? What is going on when I cannot start an instance afer setting up the bridge server? I have the following error Timed out waiting for response from Bridge server or connector (status code 504).

    Thanks,

    Mario


    anon28066628 | 2018-02-07 15:20:23 UTC | #13

    Hi Mario, there are some troubleshooting steps here in the Resource Center: https://help.mypurecloud.com/articles/troubleshoot-web-services-data-dip-connector/

    The bridge server does need HTTPS (port 443) access to PureCloud


    masanchezmemo | 2018-02-08 03:47:43 UTC | #14

    Hey there Smith,

    I've been moving forward with data dip integration. I have this configuration:

    EndPointAddress: http://172.30.40.122 EndPoint: /ServiceEncuesta/ServiceEncuesta.svc/Encuesta/

    I have tested the WebService in browser with this URL: http://172.30.40.122/ServiceEncuesta/ServiceEncuesta.svc/Encuesta/1

    Request Schema:

    { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "required": [ "encuestaOpcion" ], "properties": { "encuestaOpcion": { "type": "string" } } }

    Response Schema:

    { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "required": [ "resultado" ], "properties": { "resultado": { "type": "string" } } }

    The thing is that WS is not inserting in DB. :frowning:

    Any ideas?

    Tks,

    Mario


    Jason_Mathison | 2018-02-08 14:53:07 UTC | #15

    Can you bring us up to date on where everything is? Is your data dip action returning success now? Does the Web Service have logs indicating if your data dip is reaching it?


    masanchezmemo | 2018-02-08 18:11:57 UTC | #16

    Jason,

    Thanks for your response. The action apparently is not doing anything even though I tested on any browser like this:

    http://172.30.40.122/ServiceEncuesta/ServiceEncuesta.svc/Encuesta/1

    Where "1" is the value I want to insert into a SQL DB. And the IIS shows no error when running from browser:

    2018-02-08 17:54:05 172.30.40.122 GET /ServiceEncuesta/ServiceEncuesta.svc/Encuesta/1 - 80 - 172.30.40.122 Mozilla/5.0+(Windows+NT+10.0;+WOW64;+Trident/7.0;+rv:11.0)+like+Gecko - 200 0 0 62

    And this error is shown from IIS when trying to run from PureCloud:

    2018-02-08 17:36:05 172.30.40.122 POST /ServiceEncuesta/ServiceEncuesta.svc/Encuesta/1 - 80 - 172.30.40.122 generic-datadip - 405 0 0 15

    Any clue?

    Tks,

    Mario


    Jason_Mathison | 2018-02-08 19:20:58 UTC | #17

    One thing that stands out in the traces is that when you hit the web service from your browser it is a "GET" operation, but when PureCloud makes the request it is a "POST". The bridge web service connector is very limited, including only supporting POST operations.

    If you have some control over this web service you could see about them adding support for post operations. If you don't have any control over it then you would need to create an intermediary web service to translate between PureCloud and your end web service.


    masanchezmemo | 2018-02-09 01:56:02 UTC | #18

    Jason, I'm using data dip connector. Is the same limitation to a POST request in this connector?

    Tks,

    Mario


    masanchezmemo | 2018-02-09 03:44:03 UTC | #19

    Jason,

    We changed the WS to support POST and now I'm facing a different issue. I'm having this error in Bridge Logs:

    ridge.Unrecognized.GenericPlugin.HttpClient Operation timeout: no response received from server. Endpoint='/ServiceEncuesta.svc/Encuesta?encuestaOpcion', ActionCorrelationId='4626938c-65c3-4fd4-8f7f-fc9d1c8f348f'.

    The question is: How should I set the Entpoint URI in order to be good interpreted by my WS. I'm confused in how to make a relationbetween action Endpoint and my call flow in Architect. I'm watching the action within Architect and I can define an input as literal value but it is not working :frowning:

    I really appreciate your help.

    Tks,

    Mario


    masanchezmemo | 2018-02-09 04:15:08 UTC | #20

    Jason,

    By the way, I forgot to tell you that from the Architect flow I'm sending this payload ("encuestaOpcion":"666") to endpoint /ServiceEncuesta.svc/Encuesta?encuestaOpcion.

    Tks,

    Mario


    Jason_Mathison | 2018-02-09 12:50:03 UTC | #21

    I do not think that there is any way to dynamically add a query parameter to the end of the URL. Instead what is happening is that your post currently has something like the following URL:

    http://172.30.40.122//ServiceEncuesta.svc/Encuesta?encuestaOpcion

    And the following body:

    { "encuestaOpcion" : "666" }

    You are going to need to remove the ?encuestaOpcion from the end of the endpoint and instead the web service needs to get the value from the body.

    Also, if the web service gets a bad input it should still return something (4xx or 5xx).

    Also, to answer your question "Jason, I’m using data dip connector. Is the same limitation to a POST request in this connector?". The Bridge web services connector (data dip connector) is limited to only doing POSTs.


    masanchezmemo | 2018-02-09 13:40:13 UTC | #22

    Jason,

    Changed the Endpoint and I got this from logs:

    PluginImpl2::onpluginrequestcomplete : Request PluginRequest: [AttributeMap: { 'request.sender' => [AttributeMap: { }] 'request.headers' => [AttributeMap: { 'x-forwarded-proto' => [String: {"https"}] 'connection' => [String: {"keep-alive"}] 'x-forwarded-for' => [String: {"10.40.8.62, 10.40.250.117"}] 'date' => [String: {"Fri, 09 Feb 2018 13:31:45 GMT"}] 'inin-correlation-id' => [String: {"d4ec3596-33b5-4f53-9f6a-3cd15eee04e8"}] 'content-type' => [String: {"application/json"}] 'inin-organization-id' => [String: {"a6aa82e2-115e-41b0-9f7f-015981d83b4b"}] 'user-agent' => [String: {"edge-proxy/606 (i-0539edc92ad7a7624)"}] 'inin-edgeproxy-request-id' => [String: {"d4ec3596-33b5-4f53-9f6a-3cd15eee04e8"}] 'x-forwarded-port' => [String: {"443"}] 'inin-bridge-action-request-version' => [String: {"2"}] 'accept-encoding' => [String: {"gzip, deflate, identity, x-gzip, *;q=0"}] 'inin-edge-id' => [String: {"68e36f58-06ee-4402-8c4e-fecee6f3938e"}] 'correlationid' => [String: {"d4ec3596-33b5-4f53-9f6a-3cd15eee04e8"}] 'inin-request-deadline' => [String: {"2018-02-09T13:32:37.275Z"}] }] 'request.destination' => [String: {"/actions/CustomAction"}] 'request.payload' => [String: {"{"requestBody":"{\"encuestaOpcion\":\"369\"}","configuration":{"properties":{"endpoint":"/ServiceEncuesta.svc/Encuesta/"},"config":{},"audit":{"timestamp":"2018-02-09T13:29:51.811Z","userId":"47b99cfc-0f84-4c94-8468-c2f0ef1cc139"},"id":"5a7da24f12e7ade11b7402d7","version":1,"orgGuid":"a6aa82e2-115e-41b0-9f7f-015981d83b4b"}}"}] 'request.id' => [String: {"5a7da2c1026f6c10c357e11b4338d2"}] 'request.cookie' => [String: {"0x603c0c854debe44f"}] 'request.timeout' => [RelativeTime: {0ns}] 'request.method' => [Integer: {3}] }] is returned with response PluginResponse: [AttributeMap: { 'response.request.id' => [String: {"5a7da2c1026f6c10c357e11b4338d2"}] 'response.request.cookie' => [String: {"0x603c0c854debe44f"}] 'response.protocol.status.code' => [Integer: {0}] 'response.code' => [Integer: {1}] 'response.payload' => [String: {"{"ErrorCode":"Timeout","Message":"Operation timeout: no response received from server."}"}] 'response.headers' => [AttributeMap: { }] }]

    [Context Attribute 'Thread Name']: IPC Server Proactor [Context Attribute 'Dispatcher Job Key']: "IPC Server Proactor"_V5JJ7FY2GK65X3HJ [Context Attribute 'connection.i3inet']: #5 [Context Attribute 'server.endpoint.i3ipc']: {20203158-0a85-4741-920f-496d8ff6f333} [Context Attribute 'client.endpoint.i3ipc']: {46d9d6e0-73a5-47a2-be70-fae34b64a5f6} [Context Attribute 'Plugin Instance']: {7c7c0fe9-7c84-4790-9503-97b23207bed8}


    masanchezmemo | 2018-02-09 14:13:49 UTC | #23

    Jason,

    Changed the Endpoint and I got this from logs:

    PluginImpl2::onpluginrequestcomplete : Request PluginRequest: [AttributeMap: { 'request.sender' => [AttributeMap: { }] 'request.headers' => [AttributeMap: { 'x-forwarded-proto' => [String: {"https"}] 'connection' => [String: {"keep-alive"}] 'x-forwarded-for' => [String: {"10.40.8.62, 10.40.250.117"}] 'date' => [String: {"Fri, 09 Feb 2018 13:31:45 GMT"}] 'inin-correlation-id' => [String: {"d4ec3596-33b5-4f53-9f6a-3cd15eee04e8"}] 'content-type' => [String: {"application/json"}] 'inin-organization-id' => [String: {"a6aa82e2-115e-41b0-9f7f-015981d83b4b"}] 'user-agent' => [String: {"edge-proxy/606 (i-0539edc92ad7a7624)"}] 'inin-edgeproxy-request-id' => [String: {"d4ec3596-33b5-4f53-9f6a-3cd15eee04e8"}] 'x-forwarded-port' => [String: {"443"}] 'inin-bridge-action-request-version' => [String: {"2"}] 'accept-encoding' => [String: {"gzip, deflate, identity, x-gzip, *;q=0"}] 'inin-edge-id' => [String: {"68e36f58-06ee-4402-8c4e-fecee6f3938e"}] 'correlationid' => [String: {"d4ec3596-33b5-4f53-9f6a-3cd15eee04e8"}] 'inin-request-deadline' => [String: {"2018-02-09T13:32:37.275Z"}] }] 'request.destination' => [String: {"/actions/CustomAction"}] 'request.payload' => [String: {"{"requestBody":"{\"encuestaOpcion\":\"369\"}","configuration":{"properties":{"endpoint":"/ServiceEncuesta.svc/Encuesta/"},"config":{},"audit":{"timestamp":"2018-02-09T13:29:51.811Z","userId":"47b99cfc-0f84-4c94-8468-c2f0ef1cc139"},"id":"5a7da24f12e7ade11b7402d7","version":1,"orgGuid":"a6aa82e2-115e-41b0-9f7f-015981d83b4b"}}"}] 'request.id' => [String: {"5a7da2c1026f6c10c357e11b4338d2"}] 'request.cookie' => [String: {"0x603c0c854debe44f"}] 'request.timeout' => [RelativeTime: {0ns}] 'request.method' => [Integer: {3}] }] is returned with response PluginResponse: [AttributeMap: { 'response.request.id' => [String: {"5a7da2c1026f6c10c357e11b4338d2"}] 'response.request.cookie' => [String: {"0x603c0c854debe44f"}] 'response.protocol.status.code' => [Integer: {0}] 'response.code' => [Integer: {1}] 'response.payload' => [String: {"{"ErrorCode":"Timeout","Message":"Operation timeout: no response received from server."}"}] 'response.headers' => [AttributeMap: { }] }]

    [Context Attribute 'Thread Name']: IPC Server Proactor [Context Attribute 'Dispatcher Job Key']: "IPC Server Proactor"_V5JJ7FY2GK65X3HJ [Context Attribute 'connection.i3inet']: #5 [Context Attribute 'server.endpoint.i3ipc']: {20203158-0a85-4741-920f-496d8ff6f333} [Context Attribute 'client.endpoint.i3ipc']: {46d9d6e0-73a5-47a2-be70-fae34b64a5f6} [Context Attribute 'Plugin Instance']: {7c7c0fe9-7c84-4790-9503-97b23207bed8}


    Jason_Mathison | 2018-02-09 14:18:05 UTC | #24

    That all looks reasonable, what does the web service think is going on?


    system | 2018-03-12 14:18:19 UTC | #25

    This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.


    This post was migrated from the old Developer Forum.

    ref: 2465