You need to tell the call what type "AddResult" is. Have a look at
SOAPMappingRegistry.
cheesr
dim
On Mon, 10 Sep 2001 [EMAIL PROTECTED] wrote:
> Hi,
> I am trying to invoke a .Net enabled web service using Java with Apache SOAP toolkit.
>
> I get the following exception:
> [SOAPException: faultCode=SOAP-ENV:Client; msg=No Deserializer found to deserialize
>a 'http://localh
> ost/:AddResult' using encoding style 'http://schemas.xmlsoap.org/soap/encoding/'.;
>targetException=j
> ava.lang.IllegalArgumentException: No Deserializer found to deserialize a
>'http://localhost/:AddResu
> lt' using encoding style 'http://schemas.xmlsoap.org/soap/encoding/'.]
> at org.apache.soap.rpc.Call.invoke(Call.java:246)
> at SoapClient1.main(SoapClient1.java:39)
>
> Here's my trial code:
> /*
> * SoapClient1.java
> *
> * Created on September 9, 2001, 5:15 PM
> */
> // Required due to use of URL class , required by Call class
> import java.net.*;
>
> // Required due to use of Vector class
> import java.util.*;
>
> // Apache SOAP classes used by client
> import org.apache.soap.util.xml.*;
> import org.apache.soap.*;
> import org.apache.soap.rpc.*;
>
> /**
> *
> * @author srahul
> * @version
> */
> public class SoapClient1 {
>
> /** Creates new SoapClient1 */
> public SoapClient1() {
> }
>
> public static void main(String[] args) {
> Call call = new Call();
> call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> call.setTargetObjectURI("urn:CalcSoap");
> call.setMethodName ("Add");
> Vector params=new Vector();
> params.addElement (new Parameter ("x", String.class, "1", null));
> params.addElement(new Parameter ("y", String.class, "2", null));
> call.setParams(params);
> try {
> URL url = new URL ("http://161.85.17.164/calc.asmx");
> Response resp = call.invoke(url, "http://localhost/Add");
> if (resp.generatedFault()) {
> Fault fault=resp.getFault();
> System.out.println(" Fault code: " + fault.getFaultCode());
> System.out.println(" Fault string: "+fault.getFaultString());
> }
> Parameter result=resp.getReturnValue();
> Object o = result.getValue();
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
>
> }
>
>
>
> However i am able to iunvoke the service quite easily using c# and the proxy code
>that
> VStudio .Net generates.
> Here's the proxy file that is generated by Vstudio.net (if it is of any use...)
> //------------------------------------------------------------------------------
> // <autogenerated>
> // This code was generated by a tool.
> // Runtime Version: 1.0.2914.16
> //
> // Changes to this file may cause incorrect behavior and will be lost if
> // the code is regenerated.
> // </autogenerated>
> //------------------------------------------------------------------------------
>
> namespace GeorgeCalc.WebReference1 {
> using System.Diagnostics;
> using System.Xml.Serialization;
> using System;
> using System.Web.Services.Protocols;
> using System.Web.Services;
>
>
> [System.Web.Services.WebServiceBindingAttribute(Name="CalcSoap",
>Namespace="http://localhost/")]
> public class Calc : System.Web.Services.Protocols.SoapHttpClientProtocol {
>
> [System.Diagnostics.DebuggerStepThroughAttribute()]
> public Calc() {
> this.Url = "http://161.85.17.164/calc.asmx";
> }
>
> [System.Diagnostics.DebuggerStepThroughAttribute()]
>
>[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://localhost/Add",
>RequestNamespace="http://localhost/", ResponseNamespace="http://localhost/",
>Use=System.Web.Services.Description.SoapBindingUse.Literal,
>ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
> public int Add(int x, int y) {
> object[] results = this.Invoke("Add", new object[] {
> x,
> y});
> return ((int)(results[0]));
> }
>
> [System.Diagnostics.DebuggerStepThroughAttribute()]
> public System.IAsyncResult BeginAdd(int x, int y, System.AsyncCallback
>callback, object asyncState) {
> return this.BeginInvoke("Add", new object[] {
> x,
> y}, callback, asyncState);
> }
>
> [System.Diagnostics.DebuggerStepThroughAttribute()]
> public int EndAdd(System.IAsyncResult asyncResult) {
> object[] results = this.EndInvoke(asyncResult);
> return ((int)(results[0]));
> }
> }
> }
>
>
> Can someone please let me know, what i am doing wrong here???
>
> thanks!
> ==Rahul==
> -------------------------------------------
> [EMAIL PROTECTED]
> Ph: 5579000 Extn: 1029
> -------------------------------------------
>
>
>