Hello,

I am trying to call a simple .NET webservice with the information about the
webservice found at: http://www.xmethods.net/detail.html?id=192 with the
following code:

Call call = new Call();
call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
call.setTargetObjectURI ("PerfectXML.NET:SalesRankNPrice");
call.setMethodName ("GetAmazonSalesRank");
Vector params=new Vector();
params.addElement (new Parameter ("ISBN", String.class, param1, null));
call.setParams(params);
URL url = new URL
("http://www.PerfectXML.NET/WebServices/SalesRankNPrice/BookService.asmxhttp
://www.PerfectXML.NET/WebServices/SalesRankNPrice/BookService.asmx");
Response resp = call.invoke (url, "");
if (resp.generatedFault()) {
  Fault fault=resp.getFault();
  System.out.println(" Fault code: " + fault.getFaultCode());
  System.out.println(" Fault string: "+fault.getFaultString());
            }
else {
 Parameter result=resp.getReturnValue();
 Object o = result.getValue();
 System.out.println("Object value: "+o);
 }

I get this error:
Fault code: soap:Client Fault string:
System.Web.Services.Protocols.SoapException: Server did not recognize the
value of HTTP Header SOAPAction: .
   at System.Web.Services.Protocols.SoapServerProtocol.Initialize()
   at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type,
HttpContext context, HttpRequest request, HttpResponse response)

Is there something I am missing about the TargetObjectURI, as this seems to
be different from calling a webservice from Apache-Soap.

Thanks,

Mike

Reply via email to