axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anne Thomas Manes" <atma...@gmail.com>
Subject Re: Error message: Axis tends to invoke web service from .NET asmx
Date Sun, 11 May 2008 15:34:16 GMT
The .NET service uses wrapped document/literal, and Axis generates
rpc/encoded by default.
You need to configure the service to use style=wrapped and use=document.

You might find it easier if you use wsdl2java to generate a client
stub for you because it will generate all the proper settings for you.

Anne

On Sat, May 10, 2008 at 11:51 AM, Shu-Hao Tsao 曹書豪
<shuhao.tsao@gmail.com> wrote:
>> 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");
>>
>>
>>
>>
>> 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
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Mime
View raw message