login button

How to call SOAP 1.1 service without empty soapAction in WSDL?

Forums :

I am using Mashup Server to wrap web service from XPlanner 0.7b7. However the wsdl generated by XPlanner does not have a soapAction name in it. I extract the snippet from wsdl as following:

 

<wsdl:operation name="getProjects">
<wsdlsoap:operation soapAction=""/>
    <wsdl:input name="getProjectsRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://soap.xplanner.technoetic.com" use="encoded"/>
</wsdl:input>
    <wsdl:output name="getProjectsResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://atsg249.lss.emc.com/xplanner/soap/XPlanner" use="encoded"/>
</wsdl:output>
</wsdl:operation>

 

I encounter difficulty in calling such service since following ECMAscript totally does not work. The response equals to 2 instead of 4.

 

var xplannerService = new WSRequest();
var options = new Array();
options.useSOAP = 1.1;
options.HTTPMethod = "POST";
options.useWSA = 1.0;
options.action = "http://localhost:7070/soap/XPlanner?method=getProjects";
var endpoint = "http://localhost:7070/soap/XPlanner";
var payload = "<getProjectsRequest/>";
try {
  xplannerService.open(options, endpoint, false,"sysadmin","admin");
  xplannerService.send(payload);
  var response = xplannerService.readyState;
  return response;
} catch (e) {
    print(e);
}

 

I suspect that it is because the empty soapAction value in XPlanner's wsdl, but have not proved it. Does anyone have idea of how to call a web service without soapAction given in the WSDL?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Hi,   the soapAction is a

Hi,

 

the soapAction is a mandatory header when SOAP 1.1 is used. That should be why the WSDL has an empty soapAction. The server may use the soapAction for dispatching purposes, hence you should set the correct soapaction here. As the WSDL has no soapaction not setting the soapaction would work here. Also you can get the response as  xplannerService.responseXML or xplannerService.responseE4X.

var xplannerService = new WSRequest();
var options = new Array();
options.useSOAP = 1.1;
options.HTTPMethod = "POST";
options.useWSA = 1.0;
var endpoint = "http://localhost:7070/soap/XPlanner";
var payload = "<getProjectsRequest/>";
try {
  xplannerService.open(options, endpoint, false,"sysadmin","admin");
  xplannerService.send(payload);
  var response = xplannerService.readyState;
  return response;
} catch (e) {
    print(e);
}

 

Looking at the soapaction you,ve used i just wonder whether the endpoint should be "http://localhost:7070/soap/XPlanner?method=getProjects". May be the server did not have any information to dispatch to the correct operation.

Thanks,

Keith.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.