I'm trying, and failing, to get a very simple Web Service call via HTTP Adapter working. I must be missing something very simple.
I want to use this sample service:
http://www.webservicex.net/geoipservice.asmx I use Worklight's "Discover Backend Services" tool on the WSDL of the above service to generate the HTTP Adapter code. I deploy the adapter, then right-click - Run As - Invoke Worklight Procedure. In the Parameters area, I enter (with quotes):
"173.194.34.178"
Initially, I get an error about not having SOAPAction in the HTTP header, so I make an edit to the Adapter -impl.js to add the SOAPAction in manually:
function invokeWebService(body, headers){
var soapActionHeader = '"http://www.webservicex.net/GetGeoIP"';
var input = {
method : 'post',
returnedContentType : 'xml',
path : '/geoipservice.asmx',
headers : {'soapAction' : soapActionHeader},
body: {
content : body.toString(),
contentType : 'text/xml; charset=utf-8'
}
};
//Adding custom HTTP headers if they were provided as parameter to the procedure call
headers && (input['headers'] = headers);
return WL.Server.invokeHttp(input);
}
This sorts the SOAPAction problem out, but using Invoke Worklight Procedure again results in:
"faultstring": "System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.ArgumentNullException: Value cannot be null.\nParameter name: input\n at System.Text.RegularExpressions.Regex.IsMatch(String input)\n at WebserviceX.Service.Adapter.IPAdapter.CheckIP(String IP)\n at WebserviceX.Service.GeoIPService.GetGeoIP(String IPAddress)\n --- End of inner exception stack trace ---"
Almost like the IP address isn't actually ending up in the outbound message.
Am I entering the Parameters correctly in the Invoke Worklight Procedure dialog box? Here is a link to an image of the dialog:
https://picasaweb.google.com/lh/photo/t_BpwCVgPmiSpgKld5kMOtMTjNZETYmyPJy0liipFm0?feat=directlink