Powershell Soap WSDL Mantis Bug Tracker
Hallo Zusammen,
ich versuche ein Ticket im Mantis über die SOAP-Schnittstelle zu erstellen. Ich möchte das mit Powershell lösen. Leider komme ich mit meinen Versuchen nicht weiter.
Hier ein Auszug aus Mantis:
Web Service: MantisConnect
Target Namespace: http://futureware.biz/mantisconnect
Port MantisConnect
Port Port type
Source code
Location:http://mantis/mantis/api/soap/mantisconnect.php
Protocol:SOAP
Default style:rpc
Transport protocol:SOAP over HTTP
Diese Methode müsste ich benutzen:
Das habe ich bisher probiert:
Ausgabe:
Liesst sich so, als müsste project noch angegeben werden. Hier komm ich nun nicht mehr weiter. Project ist vom Typ ObjectRef. Mit dem anlegen des Datentyps bin ich mir schon unsicher, aber dass dann noch in die Methode "mc_issue_add" einzubinden, übersteigt leider meine Powershell kenntnisse.
Könnte mir da jemand Hilfestellung geben?
Danke und Gruß
Xearo
ich versuche ein Ticket im Mantis über die SOAP-Schnittstelle zu erstellen. Ich möchte das mit Powershell lösen. Leider komme ich mit meinen Versuchen nicht weiter.
Hier ein Auszug aus Mantis:
Web Service: MantisConnect
Target Namespace: http://futureware.biz/mantisconnect
Port MantisConnect
Port Port type
Source code
Location:http://mantis/mantis/api/soap/mantisconnect.php
Protocol:SOAP
Default style:rpc
Transport protocol:SOAP over HTTP
Diese Methode müsste ich benutzen:
Das habe ich bisher probiert:
$mantis = New-WebServiceProxy -Uri http://mantis/mantis/api/soap/mantisconnect.php?wsdl
$summary = New-Object "Microsoft.PowerShell.Commands.NewWebserviceProxy.AutogeneratedTypes.WebServiceProxy1pi_soap_mantisconnect_php_wsdl.IssueData"
#$project = New-Object "Microsoft.PowerShell.Commands.NewWebserviceProxy.AutogeneratedTypes.WebServiceProxy1pi_soap_mantisconnect_php_wsdl.ObjectRef"
#$project=@{project="IT"}
$summary=@{summary="test"}
#$mantis | get-member -type method
$response = $mantis.mc_issue_add("username","password",$summary)
$response
Ausgabe:
Ausnahme beim Aufrufen von "mc_issue_add" mit 3 Argument(en): "Error Type: SYSTEM NOTICE,
Error Description: Undefined index: project"
In C:\Temp\mantis.ps1:13 Zeichen:1
+ $response = $mantis.mc_issue_add("username","pssword",$summary)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) , MethodInvocationException
+ FullyQualifiedErrorId : SoapHeaderException
Liesst sich so, als müsste project noch angegeben werden. Hier komm ich nun nicht mehr weiter. Project ist vom Typ ObjectRef. Mit dem anlegen des Datentyps bin ich mir schon unsicher, aber dass dann noch in die Methode "mc_issue_add" einzubinden, übersteigt leider meine Powershell kenntnisse.
Könnte mir da jemand Hilfestellung geben?
Danke und Gruß
Xearo
Please also mark the comments that contributed to the solution of the article
Content-Key: 272228
Url: https://administrator.de/contentid/272228
Printed on: April 19, 2024 at 04:04 o'clock
6 Comments
Latest comment
Moin,
kenne zwar den Webservice jetzt nicht aber versuchs mal so:
Gruß jodel32
kenne zwar den Webservice jetzt nicht aber versuchs mal so:
$mantis = New-WebServiceProxy -Uri http://mantis/mantis/api/soap/mantisconnect.php?wsdl
$issue = New-Object "Microsoft.PowerShell.Commands.NewWebserviceProxy.AutogeneratedTypes.WebServiceProxy1pi_soap_mantisconnect_php_wsdl.IssueData"
$issue.summary = "BlaBlaBla"
$response = $mantis.mc_issue_add("username","password",$issue)
Ohne Zugriff auf den Webservice von hier aus schwer zu debuggen. Die Eigenschaft project ist eigentlich als optional gekennzeichnet, gibt es in der Struktur noch Eigenschaften die mandatory(Pflicht) sind, leider ist das Bild abgeschnitten ?
Kannst du den Dienst vielleicht online stellen, URL dann via PM ?
Kannst du den Dienst vielleicht online stellen, URL dann via PM ?
Zitat von @LordXearo:
Hier scheint es eine online demo zugeben.
http://demo.teclib.net/mantis/api/soap/mantisconnect.php?wsdl
username password ?Hier scheint es eine online demo zugeben.
http://demo.teclib.net/mantis/api/soap/mantisconnect.php?wsdl
probiers mal so:
$mantis = New-WebServiceProxy -Uri 'http://mantis/mantis/api/soap/mantisconnect.php?wsdl'
$issue = New-Object Microsoft.PowerShell.Commands.NewWebserviceProxy.AutogeneratedTypes.WebServiceProxy1pi_soap_mantisconnect_php_wsdl.IssueData
$project = new-Object Microsoft.PowerShell.Commands.NewWebserviceProxy.AutogeneratedTypes.WebServiceProxy1pi_soap_mantisconnect_php_wsdl.ObjectRef
$project.id = 1
$project.name = "Testname"
$issue.project = $project
$issue.summary = "BlaBla"
$mantis.mc_issue_add("username","password",$issue)