Announcement Announcement Module
Collapse
No announcement yet.
[Apache SOAP client] Holiday turorial - urgent Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • [Apache SOAP client] Holiday turorial - urgent

    Hello,

    I'm trying to use my old Apache Soap Client to access HolidayService tutorial (deployed on my local Tomcat). My problems is on passing arguments (StartDate, Endate, etc..) :

    Call call = new Call(); // org.apache.soap.rpc
    call.setTargetObjectURI("http://mycompany.com/hr/schemas");
    call.setMethodName("HolidayRequest");
    call.setEncodingStyleURI(encodingStyleURI);
    Vector params = new Vector();
    params.addElement(new Parameter("StartDate", String.class, "2008-01-01",
    encodingStyleURI));
    params.addElement(new Parameter("EndDate", String.class, "2008-01-01",
    encodingStyleURI));
    params.addElement(new Parameter("FirstName", String.class, "Joe",
    encodingStyleURI));
    params.addElement(new Parameter("LastName", String.class, "Coll",
    encodingStyleURI));
    call.setParams(params);
    The request :
    Content-Type: text/xml; charset=utf-8
    Content-Transfer-Encoding: 8bit
    Content-ID: <10883428.1208350637074.apache-soap.s00d>
    Content-Length: 641

    <?xml version='1.0' encoding='UTF-8'?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <SOAP-ENV:Body>
    <ns1:HolidayRequest xmlns:ns1="http://mycompany.com/hr/schemas" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <StartDate xsi:type="xsd:string">2008-01-01</StartDate>
    <EndDate xsi:type="xsd:string">2008-01-01</EndDate>
    <FirstName xsi:type="xsd:string">Joe</FirstName>
    <LastName xsi:type="xsd:string">Coll</LastName>
    </ns1:HolidayRequest>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    Good request should be with <b>complexType</b> :

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sch="http://mycompany.com/hr/schemas">
    <soapenv:Header/>
    <soapenv:Body>
    <sch:HolidayRequest>
    <!--You may enter the following 2 items in any order-->
    <sch:Holiday>
    <sch:StartDate>2008-01-01</sch:StartDate>
    <sch:EndDate>2008-01-01</sch:EndDate>
    </sch:Holiday>
    <sch:Employee>
    <sch:Number>?</sch:Number>
    <sch:FirstName>?</sch:FirstName>
    <sch:LastName>?</sch:LastName>
    </sch:Employee>
    </sch:HolidayRequest>
    </soapenv:Body>
    </soapenv:Envelope>
    On holidayEndPoint, no values are received.
    [Element: <ns1:HolidayRequest [Namespace: http://mycompany.com/hr/schemas]/>]




    Any suggestions will be a great help !

    Thanks
    Last edited by rgomes; Apr 16th, 2008, 08:57 AM.

  • #2
    Note that the StartDate, EndDate, etc. in the the request have no namespace, and do require one. I am not an Axis1 expert, so I am unsure how to add them.

    Comment

    Working...
    X