You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Onur Ulusu (Garanti Teknoloji)" <On...@garanti.com.tr> on 2012/08/31 13:07:50 UTC

Calling service with raw xml body

Hi,

We are developing a client side web service project with Axis2. Body of SOAP message is prepared by another process in XML form, so we need to set this raw XML body into SOAP message.
We tried the way in the code part below, but it returns XmlValueDisconnectedException.

How can we call service using raw XML data?

Thanks in advance.

Onur


// Create request
                  TeklifGonderIstem data = TeklifGonderIstem.Factory.newInstance();

                  String xmlStr = "<xml-fragment katilimciKodu=\"0062\">"+
                  "<ihal:Mes SN=\"000001\" xmlns:ihal=\"http://kas.tcmb.gov.tr/schemas/ihaleTeklif/\<http://kas.tcmb.gov.tr/schemas/ihaleTeklif/>">"+
                  "<ihal:Trh>31/08/2012</ihal:Trh><ihal:GonKK>0062</ihal:GonKK><ihal:AlKK>0001</ihal:AlKK>"+
                  "<ihal:Onc>1</ihal:Onc><ihal:IslTur>H05</ihal:IslTur><ihal:IhlK>11</ihal:IhlK>"+
                  "<ihal:IhlN>1</ihal:IhlN><ihal:TklfTur>1</ihal:TklfTur>"+
                  "<ihal:Ttr>9999999,99</ihal:Ttr></ihal:Mes></xml-fragment>";


                  XmlObject obj = XmlObject.Factory.parse(xmlStr);
                  data.set(obj);


                  request.setTeklifGonderIstem(data);

                  response = stub.teklifGonder(request);
                  cont = stub._getServiceClient().getLastOperationContext().getMessageContext("Out");
                  System.out.println("\nOUT Soap Message : "
                             + cont.getEnvelope().toString());


org.apache.xmlbeans.impl.values.XmlValueDisconnectedException
      at org.apache.xmlbeans.impl.values.XmlObjectBase.check_orphaned(XmlObjectBase.java:1213)
      at org.apache.xmlbeans.impl.values.XmlObjectBase.setterHelper(XmlObjectBase.java:1905)
      at org.apache.xmlbeans.impl.values.XmlObjectBase.set(XmlObjectBase.java:1954)