All pastes #157 Raw Edit

Anonymous

public ini v1 · immutable
#157 ·published 2004-05-17 18:07 UTC
rendered paste body
import org.apache.axis.encoding.XMLType;import java.util.*;import javax.xml.rpc.*;import org.apache.axis.message.*;import org.apache.axis.client.Call;import org.apache.axis.client.Service;import javax.xml.namespace.QName;import java.io.*; public class AxisTest2 {     /* The Following Code produces:<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body>  <RateRequest xmlns="http://www.whatever.org/"/> </soapenv:Body></soapenv:Envelope> HOWEVER, the following is what was expected:<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body>  <RateRequest xmlns="http://www.whatever.org/">    <POS>      <Source>        <UniqueId Type="IDNUM" Id="12345"/>      </Source>    </POS>  </RateRequest </soapenv:Body></soapenv:Envelope>  WHAT IS WRONG?  WHY is the xmlFromDom4j not utilized?  */     public static void main(String [] args) throws Exception{        Service  service = new Service();        Call     call    = (Call) service.createCall();         call.setTargetEndpointAddress(new java.net.URL("http://www.carrentals.com/servlet/RequestTest"));        call.setOperationStyle("document");        call.setOperationName("OTA_VehAvailRateRQ");        RPCElement element=new RPCElement("RateRequest");        element.setNamespaceURI("http://www.whatever.org/");        String xmlFromDom4j="<POS><Source><UniqueId Type=\"IDNUM\" Id=\"12345\"/></Source></POS>";        org.apache.axis.message.Text textElement=new Text(xmlFromDom4j);         textElement.setParentElement(element);        call.invoke(element);    }}