SOAP Error talking to Webservice on Apache/Axis

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Artur

    SOAP Error talking to Webservice on Apache/Axis

    Hi Newsgroup,

    im currently working on programming a asp.net application consuming an
    Webservice hosted on Apache/Axis. I have generated WSDL and Proxy
    classes from VisualStudio.ne t. But when trying to fire up one method i
    get following error:

    System.Web.Serv ices.Protocols. SoapHeaderExcep tion: Method
    'tns:prodsearch ' not implemented

    Line 55: [return:
    System.Xml.Seri alization.SoapE lementAttribute ("errorCode" )]
    Line 56: public int prodsearch(prod searchreq reqp, out string
    errorMsg, out prodsearchrespo nse resp) {
    Line 57: object[] results = this.Invoke("pr odsearch", new
    object[] {
    Line 58: reqp});
    Line 59: errorMsg = ((string)(resul ts[1]));


    [SoapHeaderExcep tion: Method 'tns:prodsearch ' not implemented]

    System.Web.Serv ices.Protocols. SoapHttpClientP rotocol.ReadRes ponse(SoapClien tMessage
    message, WebResponse response, Stream responseStream, Boolean asyncCall)
    System.Web.Serv ices.Protocols. SoapHttpClientP rotocol.Invoke( String
    methodName, Object[] parameters)
    multibooker.WsB ookingService.B ookingService.p rodsearch(prods earchreq
    reqp, String& errorMsg, prodsearchrespo nse& resp) in
    C:\Projekte\mul tibooker_2.0\mu ltibooker_sol\m ultibooker\Web
    References\WsBo okingService\Re ference.cs:57
    multibooker.Web Form1.Page_Load (Object sender, EventArgs e) in
    c:\projekte\mul tibooker_2.0\mu ltibooker_sol\m ultibooker\defa ult.aspx.cs:45
    System.Web.UI.C ontrol.OnLoad(E ventArgs e)
    System.Web.UI.C ontrol.LoadRecu rsive()
    System.Web.UI.P age.ProcessRequ estMain()

    The error is thrown on line 57!

    I have impleneted the TraceExtension Example from MSDN and get the
    following SOAP Protocols:

    -----SoapRequest at 15.08.2003 12:08:51
    <?xml version="1.0" encoding="utf-8"?><soap:Envel ope
    xmlns:soap="htt p://schemas.xmlsoap .org/soap/envelope/"
    xmlns:soapenc=" http://schemas.xmlsoap .org/soap/encoding/"
    xmlns:tns="http ://websvc.worldres .com/BookingService"
    xmlns:types="ht tp://websvc.worldres .com/BookingService/encodedTypes"
    xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http ://www.w3.org/2001/XMLSchema"><soa p:Body
    soap:encodingSt yle="http://schemas.xmlsoap .org/soap/encoding/"><tns:prodsear ch><reqp
    href="#id1" /></tns:prodsearch> <tns:prodsear ch-req id="id1"
    xsi:type="tns:p rodsearch-req"><token
    xsi:type="xsd:s tring">55TVLISD 34</token><langId
    xsi:type="xsd:i nt">1</langId><currenc y
    xsi:type="xsd:s tring">USD</currency><check InDay
    xsi:type="xsd:i nt">10</checkInDay><che ckInMonth
    xsi:type="xsd:i nt">9</checkInMonth><c heckInYear
    xsi:type="xsd:i nt">2003</checkInYear><nu mNights
    xsi:type="xsd:i nt">1</numNights><hote lId
    xsi:type="xsd:i nt">6484</hotelId><capaci tyType
    xsi:type="xsd:i nt">1</capacityType><p riceId
    xsi:type="xsd:i nt">1</priceId><numAdu lt
    xsi:type="xsd:i nt">1</numAdult><numCh ild
    xsi:type="xsd:i nt">0</numChild><numRo om
    xsi:type="xsd:i nt">1</numRoom></tns:prodsearch-req></soap:Body></soap:Envelope>
    -----SoapResponse at 15.08.2003 12:08:55
    <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope
    xmlns:SOAP-ENV="http://schemas.xmlsoap .org/soap/envelope/"
    xmlns:SOAP-ENC="http://schemas.xmlsoap .org/soap/encoding/"
    xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http ://www.w3.org/2001/XMLSchema"
    xmlns:ns1="http ://websvc.worldres .com/BookingService" ><SOAP-ENV:Body
    SOAP-ENV:encodingSty le="http://schemas.xmlsoap .org/soap/encoding/"><SOAP-ENV:Fault><faul tcode>SOAP-ENV:Client</faultcode><faul tstring>Method
    &apos;tns:prods earch&apos; not
    implemented</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>

    -----SoapRequest at 15.08.2003 12:30:13
    <?xml version="1.0" encoding="utf-8"?><soap:Envel ope
    xmlns:soap="htt p://schemas.xmlsoap .org/soap/envelope/"
    xmlns:soapenc=" http://schemas.xmlsoap .org/soap/encoding/"
    xmlns:tns="http ://websvc.worldres .com/BookingService"
    xmlns:types="ht tp://websvc.worldres .com/BookingService/encodedTypes"
    xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http ://www.w3.org/2001/XMLSchema"><soa p:Body
    soap:encodingSt yle="http://schemas.xmlsoap .org/soap/encoding/"><tns:prodsear ch><reqp
    href="#id1" /></tns:prodsearch> <tns:prodsear ch-req id="id1"
    xsi:type="tns:p rodsearch-req"><token
    xsi:type="xsd:s tring">TEST</token><langId
    xsi:type="xsd:i nt">1</langId><currenc y
    xsi:type="xsd:s tring">USD</currency><check InDay
    xsi:type="xsd:i nt">10</checkInDay><che ckInMonth
    xsi:type="xsd:i nt">9</checkInMonth><c heckInYear
    xsi:type="xsd:i nt">2003</checkInYear><nu mNights
    xsi:type="xsd:i nt">1</numNights><hote lId
    xsi:type="xsd:i nt">6484</hotelId><capaci tyType
    xsi:type="xsd:i nt">1</capacityType><p riceId
    xsi:type="xsd:i nt">1</priceId><numAdu lt
    xsi:type="xsd:i nt">1</numAdult><numCh ild
    xsi:type="xsd:i nt">0</numChild><numRo om
    xsi:type="xsd:i nt">1</numRoom></tns:prodsearch-req></soap:Body></soap:Envelope>

    -----SoapResponse at 15.08.2003 12:30:17
    <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope
    xmlns:SOAP-ENV="http://schemas.xmlsoap .org/soap/envelope/"
    xmlns:SOAP-ENC="http://schemas.xmlsoap .org/soap/encoding/"
    xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http ://www.w3.org/2001/XMLSchema"
    xmlns:ns1="http ://websvc.worldres .com/BookingService" ><SOAP-ENV:Body
    SOAP-ENV:encodingSty le="http://schemas.xmlsoap .org/soap/encoding/"><SOAP-ENV:Fault><faul tcode>SOAP-ENV:Client</faultcode><faul tstring>Method
    &apos;tns:prods earch&apos; not
    implemented</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>

    Any help appreciated.

    Artur

  • Parker Zhang [MSFT]

    #2
    Re: SOAP Error talking to Webservice on Apache/Axis

    Hello,

    One method to reformat the message is as following:

    Change the function name in the generated code:

    public int prod_search(pro dsearchreq reqp, out string errorMsg, out
    prodsearchrespo nse resp) {
    object[] results = this.Invoke("pr od_search", new object[] {reqp});
    errorMsg = ((string)(resul ts[1]));
    resp = ((prodsearchres ponse)(results[2]));
    return ((int)(results[0]));
    }

    Please note that I changed it to prod_search, so the generated message is:

    <tns:prod_searc h>
    ....
    </tns:prod_search >

    Therefore, to make the generated message looks like
    <tns:prod-search>...</tns:prod-search>, you should change the function name
    to prod-search, which is not a valid name.

    After I changed the function name to prod_search, and then I invoked your
    web method using the following code:

    com.worldres.ws qa.BookingServi ce bs = new
    com.worldres.ws qa.BookingServi ce();

    string err;
    wsclient.com.wo rldres.wsqa.pro dsearchreq prodreq = new
    wsclient.com.wo rldres.wsqa.pro dsearchreq();
    wsclient.com.wo rldres.wsqa.pro dsearchresponse prodres = new
    wsclient.com.wo rldres.wsqa.pro dsearchresponse ();

    bs.prod_search( prodreq, out err, out prodres);
    Console.WriteLi ne (err);

    I got WS_ERR_SITE ws_sm_login error in the console window.

    It seems to work, right?

    However, it is not recommened to modify the generated code, please modify
    the service on the Apache.


    --
    Parker Zhang
    Microsoft Developer Support

    This posting is provided "AS IS" with no warranties, and confers no rights.

    Comment

    • Artur

      #3
      Re: SOAP Error talking to Webservice on Apache/Axis

      >It seems to work, right?
      yes it works. But now im struggling with another error
      with arrays and classes serialization.
      [color=blue]
      >However, it is not recommened to modify the generated
      >code, please modify
      >the service on the Apache.[/color]
      I will try to forward this to our partner. Maybe they will
      modify the Service on the Apache-Side.

      Artur

      Comment

      Working...