cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

Please help me create WTPart with WRS

cko
12-Amethyst
12-Amethyst

Please help me create WTPart with WRS

I am creating and testing simple functions using EXCEL VBA.
I am testing the function with WRS before coding EXCEL VBA.
 
WRS > PTC Product Management Domain V6 > Testing POST /CreateParts results in an error
 
Where the error occurs
 "Context@odata.bind": "Containers('OR:wt.pdmlink.PDMLinkProduct:131308')",
 
 
erro code : 400
 - MALFORMED_BINDING_LINK
 - "The format of 'binding link' is incorrect."
 
Many users have asked about the above issue in Google search results, and I have tested it several times by referring to the answers.
 
1. I tested it by referring to the PTC manual, but an error occurred.,  - MALFORMED_BINDING_LINK
 
    **** Request Body
 
      {
"Name":"TestWTPart_001",
"AssemblyMode": {
"Value": "separable",
"Display": "Separable"
    },
 
"PhantomManufacturingPart" : false,
"Context@odata.bind": "Containers('OR:wt.pdmlink.PDMLinkProduct:48507000')"
      }
 
2. I also defined "Folder@odata.bind", but I get an error
3. I also defined "PTC.DataAdmin.Containers ('OR:wt.pdmlink.PDMLinkProduct:131308') ", but an error occurs
 
Anyone who has successfully created WTPart with WRS, please help me.
 
thank you
koko

k1.png

9 REPLIES 9

Hi cko,

Thank you for your question. 

Your post appears well documented but has not yet received any response. I am replying to raise awareness. Hopefully, another community member will be able to help.

Thanks & Regards,

Vivek N
Community Moderation Team.

BjoernRueegg
17-Peridot
(To:cko)

Since you haven't pasted an error it's difficult to find the exact problem. It could be that you forgot to set the binding of the odata type?
This should work:

{
  "@odata.type": "#PTC.ProdMgmt.Part",
  "AssemblyMode": {
    "Value": "component"
  },
  "EndItem": false,
  "Context@odata.bind": "Containers('OR:wt.pdmlink.PDMLinkProduct:131439')",
  "DefaultUnit": {
    "Value": "ea"
  },
  "DefaultTraceCode": {
    "Value": "0"
  },
  "View": "Design",
  "GatheringPart": false,
  "Source": {
    "Value": "make"
  },
  "PhantomManufacturingPart": false,
  "Name": "Test Rest"
}

 

cko
12-Amethyst
12-Amethyst
(To:BjoernRueegg)

Thank you

I tested WRS but I get the same error. The error is below (T.T)
If WRS passes the test, I want to develop it with excel VBA 

Error: 400

Response body
*******************************************************************
{
"error": {
"code": "MALFORMED_BINDING_LINK",
"message": "The format of 'binding link' is incorrect."
}
}
*******************************************************************

Response headers

*******************************************************************
connection: close
content-type: application/json;odata.metadata=minimal
date: Thu,22 Aug 2024 21:49:27 GMT
odata-version: 4.0
server: Apache
transfer-encoding: chunked
vary: Accept-Encoding,User-Agent
x-content-type-options: nosniff
x-do-not-compress-this: 1
x-frame-options: SAMEORIGIN
x-ptc-connected:
*******************************************************************

BjoernRueegg
17-Peridot
(To:cko)

does it work inside the Windchill WRS page? Or with which program are you running the code? The easiest way is to run it inside Windchill. If the call is failing there, you probably have a problem with an OIR?

cko
12-Amethyst
12-Amethyst
(To:BjoernRueegg)

Thank you

Tested on Windchill PDMLink 13.0 WRS.
ORI (Object Initialization Rules) used existing settings.
We will test by adding the default folder of Context.

Unfortunately,
It seems that no user has succeeded in this.

 

rleir
17-Peridot
(To:cko)

- JSON format is a bit strict, make sure the format is correct

- get it working with 'export importable' first, then try WRS

- as others have said, get it working in the WRS web page first before VBA

- experiment with the GET api's first before learning the POST api's

- VBA? you might find python easier to use

Hope this helps.

 

cko
12-Amethyst
12-Amethyst
(To:rleir)

thank you
I have a question

1. get it working with 'export importable' first
   -> Where do I configure Windchill?  No separate settings were made.

2. The reason we use VBA is because we use "VBA-JSON"
   -> Even non-programmers can easily create their own programs. That's why I like VBA.
        I'll also study Python (^_^)
   -> I created a VBA code using Chat-GTP/Bard.

thank you

 

rleir
17-Peridot
(To:cko)

Did you export an importable yet?

Actions_Export_Importable.png

You used 'Chat-GTP/Bard'? That might be a good start, but .. but ..

MT_11904660
5-Regular Member
(To:BjoernRueegg)

Hi thanks, it was helpful for me. Thanks for your efforts.

Announcements

Top Tags