How To Integrate Bartender With Php Via Web Service? フォローする

0
Avatar
Legacy Poster

Hello,

 

We need to integrate BarTender with PHP via Web Service. We are following this. https://github.com/JDBurnZ/PHPBarTender

 

But we don't have any clue how to move forward then? any setups, integration, code, URLs to make?

 

Can we have code examples and with flow and life cycle?

 

We tried also with Integration Builder from Software but we are not getting what do to from there.

 

Please guide.

 

Thanks,

4 コメント

0
Avatar
Ian Cummings
モデレータ
コメントアクション Permalink

The use of a web service event on the Integrations Platform is definitely the way you'd want to go.  Are you wishing to execute a GET with param values or POST with BTXML/CSV payload?  I could put together a BTIN file (Integrations Builder) example for you if you like, depending on what you're after.

0
Avatar
Legacy Poster
コメントアクション Permalink

We would like to use "POST with BTXML/CSV payload". Can you please send a BTIN file (Integration Builder) example for us? A sample with a basic example will be fine.

 

However, we tried creating one Integration Builder File with some steps and we are able to run Web Service in our local browser and it sending data to specified printer and spooling and printing the template data.

 

But the main question is how to combine all these things into Web App like PHP or simply JSON call with html ajax. 

 

Web Service URL: http://localhost:6262/Integration/WebServiceIntegration/Execute.  It runs on its own. How to send custom data to it.    A Video guide will be a great help for all of these.

 

Thanks

0
Avatar
Ian Cummings
モデレータ
コメントアクション Permalink

Note that we are in the process of producing written materials, videos, and we plan on adding assistant wizards to the Integration Builder to help with the process of making integrations.

 

I'm still investigating the use of JSON directly, but in the meantime you can use a PowerShell command to transform the JSON data into CSV data, run the action to transform text to record set, and then use that record set as source data for a BarTender print job.

 

Here is the PowerShell script to transform JSON into CSV.  Note that you might need PowerShell v4.0 or above installed on your computer.

 

$myInput = @"
%EventData%
"@
$myInput | ConvertFrom-Json | ConvertTo-Csv -NoTypeInformation
 
The output of this is set to the %ShellCommandOutput% variable that can be used as an input for the transform to record set action.
 
I attach a bare bones BTIN file which you can use for reference, but which you'll need to modify and complete in order to get it printing labels.
0
Avatar
Ian Cummings
モデレータ
コメントアクション Permalink

Update on how to use JSON data.
 
If we assume the below JSON data is being POSTed to your web service on the Integrations Platform:
 
{
"CompanyName": "Seagull Scientific",
"Address": "Madrid, Spain",
"PostCode": "28001"
}
 
Make sure the "Input Data" for your integrations is set to "JSON Variables".
 
This would create in the integration at time of the event the following Variables that can then be used in your integration actions.  There is no need to create custom variables in a predefined way:
 
%CompanyName%
%Address%
%PostCode%
 
*Note that these variables are case sensitive.
 
If you wanted to transform this data into a CSV, which BarTender could then deal with as a record set, then add a Set Variables action, give it a name like JSONdata, and then a value like below:
 
"CompanyName","Address","Postcode"
"%CompanyName%","%Address%","%PostCode%"
 
I hope that helps.

ログインしてコメントを残してください。