I've tried quite a few different things, including change of host, API version and so forth - but I'm fumbling around in the dark, aimlessly trying to find the right magic words - which isn't very productive. I'm sure that I'm vaguely in the right area, and that it's just a matter of fixing the request (code below). Can anyone see what I've done wrong?
<?xml version="1.0"?>Cheers,
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://thalesgroup.com/RTTI/2014-02-20/ldb/" xmlns:ns2="http://thalesgroup.com/RTTI/2010-11-01/ldb/commontypes">
<SOAP-ENV:Header>
<ns2:AccessToken>
<ns2:TokenValue>*** TOKEN GOES HERE ***</ns2:TokenValue>
</ns2:AccessToken>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<ns1:GetDepartureBoardRequest>
<ns1:numRows>10</ns1:numRows>
<ns1:crs>MAN</ns1:crs>
</ns1:GetDepartureBoardRequest>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Had the same issue and what Peter suggests (switching to https://lite.realtime.nationalrail.co.uk/OpenLDBWS/) solved it out.
I've the SOAP request (including your token, which you probably shouldn't post!), and I get a valid response back.That's great! Thank you for this - I feel so close that I can touch the solution (is the finish line in sight!?). I now get "Result Server did not recognize the value of HTTP Header SOAPAction: http://thalesgroup.com/RTTI/2014-02-20/ldb/GetDepartureBoard." Looks like login now works, but that something else is broken.
[theRequest addValue: @"http://thalesgroup.com/RTTI/2014-02-20/ldb/GetDepartureBoard" forHTTPHeaderField:@"SOAPAction"];
-(void)getTimeTableData
{
soapMessage = [NSString stringWithFormat:@"<?xml version=\"1.0\"?>\n"
"<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ns1=\"http://thalesgroup.com/RTTI/2014-02-20/ldb/\" xmlns:ns2=\"http://thalesgroup.com/RTTI/2010-11-01/ldb/commontypes\">\n"
" <SOAP-ENV:Header>\n"
" <ns2:AccessToken>\n"
" <ns2:TokenValue>xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx</ns2:TokenValue>\n"
" </ns2:AccessToken>\n"
" </SOAP-ENV:Header>\n"
" <SOAP-ENV:Body>\n"
" <ns1:GetDepartureBoardRequest>\n"
" <ns1:crs>LST</ns1:crs>\n"
" <ns1:numRows>10</ns1:numRows>\n"
" </ns1:GetDepartureBoardRequest>\n"
" </SOAP-ENV:Body>\n"
"</SOAP-ENV:Envelope>"];
NSURL *url = [NSURL URLWithString:@"https://lite.realtime.nationalrail.co.uk/OpenLDBWS/ldb6.asmx"];
NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url];
NSString *msgLength = [NSString stringWithFormat:@"%lu", (unsigned long)[soapMessage length]];
[theRequest addValue:@"thalesgroup.com" forHTTPHeaderField:@"Host"];
[theRequest addValue: @"text/xml; charset=utf-8" forHTTPHeaderField:@"Content-Type"];
[theRequest addValue: @"http://thalesgroup.com/RTTI/2014-02-20/ldb/GetDepartureBoard" forHTTPHeaderField:@"SOAPAction"];
[theRequest addValue: msgLength forHTTPHeaderField:@"Content-Length"];
[theRequest setHTTPMethod:@"POST"];
[theRequest setHTTPBody: [soapMessage dataUsingEncoding:NSUTF8StringEncoding]];
NSURLConnection *connection =
[[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
if(connection)
{
webResponseData = [NSMutableData data] ;
}
else
{
NSLog(@"Connection is NULL");
}
}
--
You received this message because you are subscribed to the Google Groups "A gathering place for the Open Rail Data community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openraildata-t...@googlegroups.com.
To post to this group, send email to openrail...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
If I remove the SOAPAction header, the response is the following SOAP error: Unable to handle request without a valid action parameter. Please supply a valid soap action.
<soap:Body>
<ldb:GetDepartureBoard>
<ldb:numRows>10</ldb:numRows>
<ldb:crs>RIC</ldb:crs>
</ldb:GetDepartureBoard>
</soap:Body>i.e. GetDepartureBoard rather than GetDepartureBoardRequest.
POST /OpenLDBWS/ldb6.asmx HTTP/1.1 Host: lite.realtime.nationalrail.co.uk Content-Type: text/xml Cache-Control: no-cache <?xml version="1.0"?>