Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X
Hello
I am trying to call Windchill custom url https://hostname/Windchill/servlet/custom/path
From Browser where SSO works it returns string value
However when I created Swagger connector with Configured SSO on Thingworx it returns
something like this
ContentLoaderFunctions.GetText - works with basic Authentication but I need SSO
Any ides?
What is the URL supposed to return, a String? It looks like it returns an object.
I want to run https://hostname/Windchill/servlet/custom/getNumber?number=123456
with SSO
This URL returns in postman STRING text
Code from bellow works but I need SSO. That's why I created Swagger connector
let headers = {
"Accept": "text/plain",
"Authorization": authorization
}
let params = {
proxyScheme: undefined /* STRING {"defaultValue":"http"} */,
headers: headers /* JSON */,
ignoreSSLErrors: undefined /* BOOLEAN */,
useNTLM: undefined /* BOOLEAN {"defaultValue":false} */,
workstation: undefined /* STRING {"defaultValue":""} */,
useProxy: undefined /* BOOLEAN {"defaultValue":false} */,
withCookies: undefined /* BOOLEAN {"defaultValue":false} */,
proxyHost: undefined /* STRING {"defaultValue":""} */,
url: "https://hostname/Windchill/servlet/custom/getNumber?number=1234567" /* STRING */,
timeout: undefined /* NUMBER {"defaultValue":60} */,
appendHeader: undefined /* BOOLEAN {"defaultValue":true} */,
proxyPort: undefined /* INTEGER {"defaultValue":8080} */,
password: undefined /* STRING */,
domain: undefined /* STRING {"defaultValue":""} */,
username: undefined /* STRING */,
};
// result: STRING
let result = Resources["ContentLoaderFunctions"].GetText(params);
I don't think ContentLoaderFunctions supports SSO. You probably have to use Thingworx Integration Runtime.
https://www.ptc.com/en/support/article/CS381498
I created Swagger Connector
SwaggerJSON value:
{
"cosumes": [
"text/html"
],
"basePath": "/Windchill",
"paths": {
"/servlet/custom/getNumber": {
"get": {
"summary": "Get Parts of type Product",
"responses": {
"200": {
"schema": {
"type": "string"
},
"description": "Successful operation"
},
"400": {
"schema": {
"type": "string"
},
"description": "Successful operation"
},
"404": {
"schema": {
"type": "string"
},
"description": "Successful operation"
},
"406": {
"schema": {
"type": "string"
},
"description": "Successful operation"
}
},
"description": "Get Number of type Product",
"operationId": "Get_Number_of_type_Product",
"parameters": [
{
"in": "query",
"uniqueItems": true,
"name": "numberRange",
"description": "",
"type": "string",
"required": false
}
],
"tags": [
"CustomEndPoint"
]
}
}
},
"host": "hostname",
"produces": [
"text/plain"
],
"schemes": [
"https"
],
"definitions": {},
"swagger": "2.0",
"info": {
"description": "Retrieves Windchill Custom endpoints",
"title": "Windchill Custom Endpoints",
"version": "1.0.0"
},
"tags": [
{
"name": "CustomEndPoint"
}
]
}
Service created for Route from JSON
returns:
Return Value should be String
Sorry, misread your message.
Nothing in the error logs?
Shouldn't "cosumes" be "consumes"?
Shouldn't "cosumes" be "consumes"?
- Did not helped
No Errors on Thingworx, on Integration Runtime, on Windchill
No idea then, sorry. You can try to increase log levels, so you see the query being sent to and returned from Windchill, but if it does not give you an error, the query seems to be a missing type conversion somewhere, mime-type maybe?
You can also try to break it on purpose and see if that gives you different error message (e.g. try servlet/custom/getNumberXXX instead of servlet/custom/getNumber