Skip to main content
Nintex Community Menu Bar

I have exposed all smartobject on my k2 server as APIs. But when I call one of the exposed URLs through a browser, I get an error (Service:  Endpoint not found) 


14342i762BD08C954CA486.png

I assume you are referring to SmartObject Services that return REST/WCF endpoints?


http://help.k2.com/onlinehelp/k2blackpearl/DevRef/4.7/default.htm#K2_SmartObject_Services_Introduction.html


 


If you hit a url similar to below (replacing with the correct hostname/port/protocol), does it return all endpoints available?  Is this where you are seeing the error?


http://dlx:8888/SmartObjectServices/endpoints/endpoints.xml


 


Or is the error thrown when you are hitting one of the endpoints from the XML result above?  I.e.


http://dlx:8888/rest/Workflow Reports/Workflow General/Process Instance


Hi,


 


Are you using WCF or Rest endpoint? I would make sure that the parameters are passing correctly. Recently, i got similar error message when trying to use the endpoint for K2 Service and I didn't pass in the correct JSON parameter. 


 


I'm getting the error when I'm hitting one of the endpoints.


1.  What type of SmartObject is this endpoint based on?  SQL, SharePoint, etc?


 


2.  How is the URL to the web service built?  Perhaps there is an unsupported character/URL parameter that is invalidating the URL and returning this EndPoint not found error .  Please attach a screenshot or the URL in question.


Hi

 

1. SmartObject - SQL based

 

 

2. Screenshots attached(K2hostserver config and url error)

 

Thanks

 



Some of these errors that you are seeing is maybe expected behaviors if the REST web service is not invoked properly.


 


Usually a SQL table SmartObject will have the following methods:


CRUDL (Created, Read, Update, Delete, LIST)


 


And REST web services are exposed accordingly, i.e.


 


http://dlx.denallix.com:8889/SmartObjectServices/rest/Default/Test Object/Create


http://dlx.denallix.com:8889/SmartObjectServices/rest/Default/Test Object/Read?ID={ID}


http://dlx.denallix.com:8889/SmartObjectServices/rest/Default/Test Object/Update?ID={ID}


http://dlx.denallix.com:8889/SmartObjectServices/rest/Default/Test Object/Delete?ID={ID}


http://dlx.denallix.com:8889/SmartObjectServices/rest/Default/Test Object/List?$format={format}&$top={top}&$skip={skip}&filterXml={filterXml}


 


Some of these methods you can just browse to in the browser, as the browser will invoke a 'GET' request, such as the 'Read' and 'List' call (which can accept a URL parameter) and will return an output (XML or JSON):


 


http://dlx.denallix.com:8889/SmartObjectServices/rest/Default/Test%20Object/Read?ID=1


http://dlx.denallix.com:8889/SmartObjectServices/rest/Default/Test%20Object/List?$format=XML


 


However the 'Create, Read, Delete' may require more complex web service calls than what the browser allows; and expecting an XML structure in the request body with certain request headers (and not just url parameters):


 


https://help.k2.com/onlinehelp/k2blackpearl/DevRef/4.7/default.htm#Create.html


- a 'POST' call


- with headers:


Content-type: application/xml


- body contain applicable XML structure (for example):


<Employee>
    <Username>DENALLIXRick</Username>
    <First_Name>Rick</First_Name>
    <Last_Name>Cowan</Last_Name>
    <Email>rick@denallix.com</Email>
</Employee>


 


https://help.k2.com/onlinehelp/k2blackpearl/DevRef/4.7/default.htm#Update.html


https://help.k2.com/onlinehelp/k2blackpearl/DevRef/4.7/default.htm#Delete.html


 


You maybe able to test 'Create', 'Update', 'Delete' using Chrome's Postman or SoapUI; as it will allow more complex HTTP requests.  Likely you will need to do the same thing in your code if you are attempting to make use of these SmartObject as web services endpoints.


 


 


 


When calling a url from postman, I get the 401 unauthorized error.

 

Configuring HTTP STN is recommended to fix this. See link below;

https://help.k2.com/onlinehelp/k2blackpearl/devref/current/default.htm#Configuration2.html

 

How do I configure the HTTP STN on my environment?


Please see the following for information regarding how to set spns:


https://social.technet.microsoft.com/wiki/contents/articles/717.service-principal-names-spns-setspn-syntax-setspn-exe.aspx


 


You will like need to run these SETSPN commands via command prompt:


 


setspn -s HTTP/dlx DENALLIXk2service
setpsn -s HTTP/dlx.denallix.com DENALLIXk2service


 


* Of cource you will need to replace hostname/fully qualified host name and service account with the applicable values from your config/environment


Reply