?

Log in

   Journal    Friends    Archive    Profile    Memories
 

The issue I have encountered with is that while writing the web… - LiveJournal ColdFusion User Group

_villain_Aug. 21st, 2006 12:17 pm

The issue I have encountered with is that while writing the web service on c# one of the parameters of the method that should be used is a array of structure. The issue is actually that the client written on ColdFusion doesn’t see my method and while launching it crashes it and displays the error. "Web service operation "test" with parameters {t2={{A={[{PRICE={12},NAME={Myname}}]}}}} could not be found. "

My question is what is the right way to declare the variables in the web service? (It is not advisable to change the client as I’m writing the web service for the client and not vice verse.)


Client:
< cfscript>
  a = ArrayNew(1);
  t=structNew();
  t.price = 12;
  t.name  = "Myname";
  a[1] = t;
  t2=structNew();
  t2.a = a;
< /cfscript>
< cfinvoke webservice="http://localhost:2851/test/Service21.asmx?WSDL" method="test" returnvariable="wsResult">
< cfinvokeargument name="t2" value=#t2#/>
< /cfinvoke>
< cfoutput>#wsResult#< /cfoutput>

WebService:

[SoapTypeAttribute(Namespace = "http://dts")]
public class postback_response
{
    public double crl_id;
    public double resp_code;
    public string resp_message;
}
[SoapTypeAttribute(Namespace = "http://dts")]
public struct test_c2
{
    public test_c[] a;
}
[SoapTypeAttribute(Namespace = "http://dts")]
public class test_c
{
    public double price;
    public string name;
}

    [WebMethod(), SoapRpcMethod(Use = System.Web.Services.Description.SoapBindingUse.Literal)]
    public postback_response test(test_c2 t2)
    {

        postback_response response = new postback_response();
        response.crl_id = 1;
        response.resp_code = 0;
        response.resp_message = "test";
        return response;
    }

Current Music: Vinnickaya Alena - Izmuchennoe serdce (Gorchitza Remix)

Leave a commentPrevious Entry Share Next Entry