~ubuntu-branches/ubuntu/trusty/nordugrid-arc/trusty

« back to all changes in this revision

Viewing changes to src/hed/mcc/soap/MCCSOAP.cpp

  • Committer: Package Import Robot
  • Author(s): Mattias Ellert
  • Date: 2012-12-13 16:41:31 UTC
  • mfrom: (3.1.11 sid)
  • Revision ID: package-import@ubuntu.com-20121213164131-wii0p2fcv7e3en93
Tags: 2.0.1-1
* 2.0.1 Release
* Drop patches accepted upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
330
330
  if(soap_action_defined) {
331
331
    soap_action=inmsg.Attributes()->get("SOAP:ACTION");
332
332
  } else {
333
 
    soap_action_defined=WSAHeader(*inpayload).hasAction();
 
333
    soap_action_defined=true; //WSAHeader(*inpayload).hasAction(); - SOAPAction must be always present
334
334
    soap_action=WSAHeader(*inpayload).Action();
335
335
  };
336
336
  if(inpayload->Version() == SOAPEnvelope::Version_1_2) {
339
339
    nextinmsg.Attributes()->set("HTTP:Content-Type",mime_type);
340
340
  } else {
341
341
    nextinmsg.Attributes()->set("HTTP:Content-Type","text/xml");
342
 
    if(soap_action_defined) nextinmsg.Attributes()->set("HTTP:SOAPAction",soap_action);
 
342
    if(soap_action_defined) nextinmsg.Attributes()->set("HTTP:SOAPAction","\""+soap_action+"\"");
343
343
  };
344
344
  // Call next MCC 
345
345
  MCCInterface* next = Next();
349
349
  // Do checks and create SOAP response
350
350
  // TODO: pass SOAP action from HTTP header to SOAP:ACTION attribute
351
351
  if(!ret) {
352
 
    return make_soap_fault(outmsg,nextoutmsg,false,"Failed to send SOAP message");
353
 
  };
354
 
  if(!nextoutmsg.Payload()) return make_soap_fault(outmsg,nextoutmsg,false,"No response for SOAP message recieved");
 
352
    std::string errstr = "Failed to send SOAP message: "+(std::string)ret;
 
353
    return make_soap_fault(outmsg,nextoutmsg,false,errstr.c_str());
 
354
  };
 
355
  if(!nextoutmsg.Payload()) {
 
356
    return make_soap_fault(outmsg,nextoutmsg,false,"No response for SOAP message recieved");
 
357
  };
355
358
  MessagePayload* retpayload = nextoutmsg.Payload();
356
359
  if(!retpayload) return make_soap_fault(outmsg,nextoutmsg,false,"No valid response for SOAP message recieved");
357
360
  PayloadSOAP* outpayload  = new PayloadSOAP(*retpayload);
358
 
  if(!outpayload) return make_soap_fault(outmsg,nextoutmsg,false,"Response is not SOAP");
 
361
  if(!outpayload) {
 
362
    return make_soap_fault(outmsg,nextoutmsg,false,"Response is not SOAP");
 
363
  };
359
364
  if(!(*outpayload)) {
360
365
    delete outpayload; return make_soap_fault(outmsg,nextoutmsg,false,"Response is not valid SOAP");
361
366
  };