>
> I would like to invoke remote .NET web service with Axis client, but the
> following error message occured. Could anyone give me some advices relation
> to this issue, thanks.
>
> Client code:
>
> String postcode = request.getParameter("postcode");
>
>
> String endpointStringService = "http://www.webservicex.net/uklocation.asmx";;
>
>
>
> String methodName = "GetUKLocationByPostCode";
>
>
>
> Service service = *new* Service();
>
>
> Call callService = (Call)service.createCall();
>
>
> URL endpointService = *new* URL(endpointStringService);
>
>   callService.setTargetEndpointAddress(endpointService);
>
> callService.setOperationName(methodName);
> callService.setUseSOAPAction(*true*);
> callService.setSOAPActionURI("http://www.webserviceX.NET/GetUKLocationByPostCode
>  <http://www.webservicex.net/GetUKLocationByPostCode>");
>
>
>
>
> callService.addParameter("PostCode", XMLType.XSD_STRING, ParameterMode.IN);
> callService.setReturnType(XMLType.XSD_STRING );
>
> String result = (String)callService.invoke(*new* Object[] {postcode});
>
>
>
> Error Message:
>
> *System.Web.Services.Protocols.SoapException: Server was unable to process
> request. ---> System.Data.SqlClient.SqlException: Procedure or function
> 'GetUKLocationByPostCode' expects parameter '@PostCode', which was not
> supplied.*
> at WebServicex.UKLocation.GetUKLocationByPostCode(String PostCode)
> --- End of inner exception stack trace ---
> org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
>
> org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
>
> org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
>
> org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
> org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown
> Source)
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
> Source)
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> Source)
> org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
> org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
> org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
> org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
>
> org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
> org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
> org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
>
> org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
> org.apache.axis.client.Call.invokeEngine(Call.java:2784)
> org.apache.axis.client.Call.invoke(Call.java:2767)
> org.apache.axis.client.Call.invoke(Call.java:2443)
> org.apache.axis.client.Call.invoke(Call.java:2366)
> org.apache.axis.client.Call.invoke(Call.java:1812)
> org.apache.jsp.WebService.location_jsp._jspService(location_jsp.java:95)
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
>
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>
> --
> Best Regards,
>
> Shu-Hao Tsao

Reply via email to