SOAP and TS

Обсуждаем TrackStudio по-русски

SOAP and TS

Postby sergey.kravchuk » Thu Oct 20, 2011 4:21 am

День добрый.

Подскажите в чем моя ошибка?
Когда я посылаю:
Code: Select all
SOAP request: http://trackstudio.developonbox.ru/TrackStudio/services/User
SOAPAction: "authenticate", Content-Type: text/xml;charset=UTF-8, Content-Length: 384
<?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsdl="http://user.service.soap.trackstudio.com/" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Body><authenticate><login>sergey.kravchuk</login><password>***</password></authenticate></env:Body></env:Envelope>


Я получаю ответ:
Code: Select all
SOAP response (status 415)
sergey.kravchuk
 
Posts: 8
Joined: Thu Sep 08, 2011 12:31 am

Re: SOAP and TS

Postby Petr » Thu Oct 20, 2011 11:26 am

через что вы запрос формируете?
TS Support
email: parsentev@yandex.ru
Petr
 
Posts: 1317
Joined: Wed Aug 12, 2009 4:38 pm

Re: SOAP and TS

Postby sergey.kravchuk » Thu Oct 20, 2011 12:20 pm

sergey.kravchuk
 
Posts: 8
Joined: Thu Sep 08, 2011 12:31 am

Re: SOAP and TS

Postby admin » Thu Oct 20, 2011 12:41 pm

В чем именно дело - не понятно, на стороне сервера в trackstudio.log ошибки есть ? Еще вот тут посмотрите, клиент приводит рабочий запрос, он немного отличается

issue-15370.html
Maxim Kramarenko (mailto: maximkr@trackstudio.com)
TrackStudio - Hierarchical Bug & Issue Tracking Software
http://www.trackstudio.com
admin
Site Admin
 
Posts: 7454
Joined: Thu Jan 01, 1970 3:00 am
Location: Smolensk, Russia

Re: SOAP and TS

Postby sergey.kravchuk » Thu Oct 20, 2011 2:22 pm

Проблема крылась в Content-Type:.
Нужно было Content-Type: application/soap+xml .

Но у меня другая проблема:
Code: Select all
SOAP request: http://trackstudio.developonbox.ru/TrackStudio/services/User
SOAPAction: "authenticate", Content-Type: application/soap+xml;charset=UTF-8, Content-Length: 367
<?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsdl="http://user.service.soap.trackstudio.com/" xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><authenticate><login>sergey.kravchuk</login><password>***</password></authenticate></env:Body></env:Envelope>
HTTPI executes HTTP POST using the net_http adapter
SOAP response (status 500):
<?xml version="1.0" ?><S:Envelope xmlns:S="http://www.w3.org/2003/05/soap-envelope"><S:Body><S:Fault xmlns:ns3="http://schemas.xmlsoap.org/soap/envelope/"><S:Code><S:Value>S:Sender</S:Value></S:Code><S:Reason><S:Text xml:lang="en">Cannot find dispatch method for {}authenticate</S:Text></S:Reason></S:Fault></S:Body></S:Envelope>
Savon::SOAP::Fault: (S:Sender) Cannot find dispatch method for {}authenticate
sergey.kravchuk
 
Posts: 8
Joined: Thu Sep 08, 2011 12:31 am

Re: SOAP and TS

Postby sergey.kravchuk » Thu Oct 20, 2011 5:13 pm

Code: Select all
SOAP request: http://trackstudio.developonbox.ru/TrackStudio/services/User
SOAPAction: "authenticate", Content-Type: application/soap+xml;charset=UTF-8, Content-Length: 377
<?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap="http://user.service.soap.trackstudio.com/" xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><soap:authenticate><login>root</login><password>root</password></soap:authenticate></env:Body></env:Envelope>

Вот так выглядит правильны запрос.
sergey.kravchuk
 
Posts: 8
Joined: Thu Sep 08, 2011 12:31 am

Re: SOAP and TS

Postby sergey.kravchuk » Thu Oct 20, 2011 5:42 pm

ну и вдруг кому пригодится:

Code: Select all
Savon.configure do |config|
  config.soap_version = 2
end

client_users = Savon::Client.new do
  wsdl.document = "http://hostname/TrackStudio/services/User?wsdl"
end

response = client_users.request :soap, :authenticate, :body => { :login => "root", :password => "root" }

if response.success? and
   !response.soap_fault? and
   !response.http_error?

   sessionId = response.to_hash[:authenticate_response][:return]
end

sergey.kravchuk
 
Posts: 8
Joined: Thu Sep 08, 2011 12:31 am


Return to TrackStudio Support [Russian]

Who is online

Users browsing this forum: No registered users and 0 guests

cron