2017-10-08 5 views
0

Ich habe Web-ServiceProcess Web Service in C#

http://sandbox3.processmaker.com/sysworkflow/en/neoclassic/services/wsdl2 

Die Implementierung in PHP für die Anmeldung

<?PHP 
    /*webservice connection NOTE: Replace this WebAddress with your instance*/ 
    $client = new SoapClient('http://sandbox3.processmaker.com/sysworkflow/en/neoclassic/services/wsdl2'); 
    $params = array(array('userid'=>'admin', 'password'=>'processmaker')); 
    $result = $client->__SoapCall('login', $params); 

    /*webservice validate connection: begin*/ 
    if($result->status_code == 0){ 
     p("Connection Successful!"); 
     p("Session ID: " . $result->message); 
     $session = $result->message; 
?> 

Ich brauche diesen Web-Service in C#

I-Projekt erstellen aufzurufen, klicken unter Projektname und Servicereferenz hinzufügen

Benannt SR_Processmaker

ich Code unten verwenden sessionId

using Processmaker_Webservice.SR_Processmaker; 
string userId = "1234567892"; 
       string password = "123456789"; 
       loginRequest login = new loginRequest(userId,password); 

In Login nur userId und Passwort zu erhalten.

XML ist

<xs:schema elementFormDefault="qualified" targetNamespace="http://www.processmaker.com"> 
<xs:element name="login"> 
<xs:complexType> 
<xs:sequence> 
<xs:element name="userid" type="xs:string"/> 
<xs:element name="password" type="xs:string"/> 
</xs:sequence> 
</xs:complexType> 
</xs:element> 
<xs:element name="loginResponse"> 
<xs:complexType> 
<xs:sequence> 
<xs:element name="status_code" type="xs:integer"/> 
<xs:element name="message" type="xs:string"/> 
<xs:element name="version" type="xs:string"/> 
<xs:element name="timestamp" type="xs:string"/> 
</xs:sequence> 
</xs:complexType> 
</xs:element> 

Jeder, der Web-Service von Process benutzen Sie mir helfen. Ich bin neu und brauche deine Hilfe.

Vielen Dank.

+0

Leider erwähnen Sie nicht, was das eigentliche Problem ist, -) – khlr

+0

Wie bekomme ich Antwort von loginRequest-Methode, ich bin nicht in der Lage, etwas zu bekommen. –

Antwort

0

Sie haben den Dienst noch nicht aufgerufen. Also, was fehlt, ist das Äquivalent zu dieser PHP Zeile: $result = $client->__SoapCall('login', $params);

So benötigen Sie einen Service-Client und die Hand über die loginRequest instanziiert:

string userId = "1234567892"; 
string password = "123456789"; 
var loginRequest = new loginRequest(userId, password); 

var proxy = new ProcessMakerServiceSoapClient(); 
var loginResult = proxy.loginAsync(loginRequest); 
var result = loginResult.Result; 

proxy.Close(); 
+0

Danke Khlr, seine Arbeit. Entweder gibt es mir Statuscode 3, Login fehlgeschlagen, aber zumindest weiß ich, wie man konsumiert. Vielen Dank :) –

+0

Jetzt funktioniert es richtig gut. Danke noch einmal –