Parsing SOAP Envelope

I am new to mobile web services. I need to create a parser but my code didnot work:( Could you please help me?
* To change this template, choose Tools | Templates
* and open the template in the editor.
import java.io.*;
import javax.microedition.midlet.*;
import org.ksoap2.SoapEnvelope;
import org.kxml2.io.KXmlParser;
import org.xmlpull.v1.XmlPullParserException;
import java.io.ByteArrayInputStream;
* @author Welcome
public class MobileSOAPParsingMidlet extends MIDlet {
String msg1="<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"> <S:Header/>" +
" <S:Body> <ns2:Add xmlns:ns2=\"http://webservice/\"> <x>5</x>" +
" <y>8</y> </ns2:Add> </S:Body></S:Envelope>";
String msg2 = " <Envelope Version= \"1\"> <Body> <WebService> <Action>Add</Action> <x>5</x> <y>8</y> </WebService> </Body></Envelope>";
String msg = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
"<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" " +
" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " +
" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">\n" +
" <getRating xmlns=\"http://tempuri.org\">\n" +
" </getRating>\n" +
" </soap:Body>\n" +
"</soap:Envelope>";
public void startApp() {
byte[] xmlByteArray = msg.getBytes();
ByteArrayInputStream xmlStream = new ByteArrayInputStream( xmlByteArray );
InputStreamReader xmlReader = new InputStreamReader( xmlStream );
KXmlParser parser = new KXmlParser();
try {
parser.setInput(xmlStream, msg);
} catch (XmlPullParserException ex) {
ex.printStackTrace();
SoapEnvelope soapenvelope=new SoapEnvelope(SoapEnvelope.VER12);
try {
soapenvelope.parse(parser);
} catch (IOException ex) {
ex.printStackTrace();
} catch (XmlPullParserException ex) {
ex.printStackTrace();
// catch(UnsupportedEncodingException e){
// System.err.println(e);
public void pauseApp() {
public void destroyApp(boolean unconditional) {
}

I accidently hit the post before the messag was composed.
I'm trying to parse an XML soap envelope found in a collection. I can do it in TOAD but get a "ORA-01008: not all variables bound" message in APEX within a PL/SQL anonymous block
Here is the code snippet:
declare
l_xml clob;
l_pdf                    clob;
begin
select xmltype.createxml(cm.clob001)
into l_xmlval
from ....
select l_xmlval.extract('//*[local-name()=''reportBytes]').getclobval()
into l_pdf
from dual;
end;
It is the presense of the two backslashes that cause the ORA-01008. Does anybody know how to resolve this problem?
Alex

Similar Messages

  • Web service parsing soap envelope problem

    I'm trying to parse an XML document found in a collection. I can do it in TOAD but get a "ORA-01008: not all variables bound" message in APEX.

    I accidently hit the post before the messag was composed.
    I'm trying to parse an XML soap envelope found in a collection. I can do it in TOAD but get a "ORA-01008: not all variables bound" message in APEX within a PL/SQL anonymous block
    Here is the code snippet:
    declare
    l_xml clob;
    l_pdf                    clob;
    begin
    select xmltype.createxml(cm.clob001)
    into l_xmlval
    from ....
    select l_xmlval.extract('//*[local-name()=''reportBytes]').getclobval()
    into l_pdf
    from dual;
    end;
    It is the presense of the two backslashes that cause the ORA-01008. Does anybody know how to resolve this problem?
    Alex

  • Parse a soap envelope

    I have a SOAP response envelope that I am trying to parse using extractvalue.
    The response is stored in a xmltype field in a table.
    Table
    create table ws_results
    (x xmltype);SOAP Response
    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
         <s:Header>
              <ActivityId CorrelationId="12855f8e-d2be-40c7-81d8-fafa3cf9a779" xmlns="http://schemas.microsoft.com/2004/09/ServiceModel/Diagnostics">d24174d3-e095-460a-b9f8-2bae66efe813</ActivityId>
         </s:Header>
         <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
              <FetchResponse xmlns="urn: WA.Ecy.ADS.FacilitySite.Services">
                   <FacilitySiteId>99997167</FacilitySiteId>
              </FetchResponse>
         </s:Body>
    </s:Envelope>Here is the SQL that I attempting to use to get the Facility Site ID out
    select extractvalue(x,'/FetchResponse/FacilitySiteId') from ws_results;
    select extractvalue(x,'/FetchResponse/FacilitySiteId','xmlns="http://microsoft.com/wsdl/types/"')
    from ws_resultsThese returns a null.
    Seems like this should be pretty straightforward and I am sure that I am missing something small. Any help would be appreciated.
    Thanks, Tony

    The problem seems to be (at least with me testing) is the xmlns="urn: WA.Ecy.ADS.FacilitySite.Services". Oracle considers it invalid xpath. If it is replaced with "http://www.ms.com/xml", then it seems OK with xpath. You can test this:
    declare
         ---v_xmlText          clob ;      ---varchar2(32765);
         v_xmlText          sys.xmltype;
         v_FacID               varchar2(50) := null;
         v_FacilitySiteId     varchar2(50) := null;
         v_FacilitySiteName     varchar2(50) := null;
    begin
         v_xmlText := sys.xmlType('
    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
         <s:Header>
              <ActivityId CorrelationId="48538673-36c0-4f6d-8c05-94b753d0e3ab"
              xmlns="http://schemas.microsoft.com/2004/09/ServiceModel/Diagnostics">
              b4af9688-a929-4b9f-a187-fb68f3927240
              </ActivityId>
         </s:Header>
         <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns:xsd="http://www.w3.org/2001/XMLSchema">
              <FacilitySiteResponse xmlns="http://www.ms.com/xml">
                   <FacilitySiteEntity>
                        <Id>99997167</Id>
                        <FacilitySiteId>99997167</FacilitySiteId>
                        <FacilitySiteName>My New Test Facility</FacilitySiteName>
                        <FacilitySiteKeySearchName>My New Te</FacilitySiteKeySearchName>
                        <VirtualSiteFlag>78</VirtualSiteFlag>
                        <GeographicLocationId>99997167</GeographicLocationId>
                        <CreatedDate>2008-11-07T07:32:21.07</CreatedDate>
                        <ModifiedByName>taus461</ModifiedByName>
                        <ModifiedDate>2008-11-07T07:44:20.723</ModifiedDate>
                        <CreatedByName>taus461</CreatedByName>
                   </FacilitySiteEntity>
                   <GeographicLocationEntity>
                        <Id>99997167</Id>
                        <GeographicLocationId>99997167</GeographicLocationId>
                        <AddressLine1>2020 22nd Ave SE</AddressLine1>
                        <CityName>Olympia</CityName>
                        <CongressionalDistrictNumber xsi:nil="true"/>
                        <COORD_XTNT_CD xsi:nil="true"/>
                        <HorizontalDatumCode>3</HorizontalDatumCode>
                        <HorizontalAccuracyLevelCode>13</HorizontalAccuracyLevelCode>
                        <HorizontalCollectionMethodCode>2</HorizontalCollectionMethodCode>
                        <GeographicPositionCode>8</GeographicPositionCode>
                        <LatitudeDecimalNumber xsi:nil="true"/>
                        <LatitudeDegreeNumber xsi:nil="true"/>
                        <LocationVerifiedFlag xsi:nil="true"/>
                        <LatitudeMinutesNumber xsi:nil="true"/>
                        <LatitudeSecondsNumber xsi:nil="true"/>
                        <LongitudeDecimalNumber xsi:nil="true"/>
                        <LongitudeDegreeNumber xsi:nil="true"/>
                        <LongitudeMinutesNumber xsi:nil="true"/>
                        <LongitudeSecondsNumber xsi:nil="true"/>
                        <BaseReferenceCode>SPCS</BaseReferenceCode>
                        <SOURCE_SCALE_CD>99</SOURCE_SCALE_CD>
                        <VerticalMeasureNumber xsi:nil="true"/>
                        <VerticalMeasureUnitCode>FT</VerticalMeasureUnitCode>
                        <VerticalReferenceCode xsi:nil="true"/>
                        <VerticalCollectionMethodCode xsi:nil="true"/>
                        <VerticalDatumCode xsi:nil="true"/>
                        <VerticalAccuracyLevelCode xsi:nil="true"/>
                        <CountyCodeNumber xsi:nil="true"/>
                        <LocationDescription1>This is my test facility decription</LocationDescription1>
                        <EPARegionName xsi:nil="true"/>
                        <GISVerifiedFlag xsi:nil="true"/>
                        <LegislativeDistrictNumber xsi:nil="true"/>
                        <IndianLandFlag>78</IndianLandFlag>
                        <RangeDirectionCode xsi:nil="true"/>
                        <RangeNumber xsi:nil="true"/>
                        <RegionCode/>
                        <SectionNumber xsi:nil="true"/>
                        <StateCode>WA</StateCode>
                        <SPCSXCoordinateNumber xsi:nil="true"/>
                        <SPCSYCoordinateNumber xsi:nil="true"/>
                        <SPCSZoneCode xsi:nil="true"/>
                        <TownshipDirectionCode xsi:nil="true"/>
                        <TownshipNumber xsi:nil="true"/>
                        <UTMXCoordinateNumber xsi:nil="true"/>
                        <UTMYCoordinateNumber xsi:nil="true"/>
                        <UTMZoneCode xsi:nil="true"/>
                        <WRIAIdNumber xsi:nil="true"/>
                        <ZipCode>98501</ZipCode>
                        <PLAIndicatorCode xsi:nil="true"/>
                        <GISReferenceNumber xsi:nil="true"/>
                        <GISCalculatedLatDecimalNumber xsi:nil="true"/>
                        <GISCalculatedLongDecimalNumber xsi:nil="true"/>
                        <ModifiedByName>taus461</ModifiedByName>
                        <ModifiedDate>2008-11-07T07:44:20.74</ModifiedDate>
                        <CreatedDate xsi:nil="true"/>
                        <CreatedByName>taus461</CreatedByName>
                        <FacilitySite>
                             <Id>99997167</Id>
                             <FacilitySiteId>99997167</FacilitySiteId>
                             <FacilitySiteName>My New Test Facility</FacilitySiteName>
                             <FacilitySiteKeySearchName>My New Te</FacilitySiteKeySearchName>
                             <VirtualSiteFlag>78</VirtualSiteFlag>
                             <GeographicLocationId>99997167</GeographicLocationId>
                             <CreatedDate>2008-11-07T07:32:21.07</CreatedDate>
                             <ModifiedByName>taus461</ModifiedByName>
                             <ModifiedDate>2008-11-07T07:44:20.723</ModifiedDate>
                             <CreatedByName>taus461</CreatedByName>
                        </FacilitySite>
                   </GeographicLocationEntity>
                   <IsOperationSuccess>true</IsOperationSuccess>
              </FacilitySiteResponse>
         </s:Body>
    </s:Envelope>');
         select fac.facID, fac.FacilitySiteId, fac.FacilitySiteName
              into v_FacID, v_FacilitySiteId, v_FacilitySiteName
         from
         xmltable
              xmlnamespaces
                   default 'http://www.ms.com/xml'     
                   ---'http://www.ms.com/xml'
                   ---'http://schemas.xmlsoap.org/ws/2004/08/addressing' as "wsa",
                   ---'http://www.w3.org/2003/05/soap-envelope' as "soap"
              '//FacilitySiteResponse'
              passing v_xmlText
              columns
              FacID               varchar2(50)     path     '//FacilitySiteEntity/Id',
              FacilitySiteId          varchar2(50)     path     '//FacilitySiteEntity/FacilitySiteId',
              FacilitySiteName     varchar2(50)     path     '//FacilitySiteEntity/FacilitySiteName'
         ) fac;
         dbms_output.put_line('FacID = ' || v_FacID);
         dbms_output.put_line('FacSiteID = ' || v_FacilitySiteId);
         dbms_output.put_line('FacSiteName = ' || v_FacilitySiteName);
                    select extractValue(v_xmlText, '//FacilitySiteResponse/FacilitySiteEntity/Id', 'xmlns="http://www.ms.com/xml"')
         into v_FacID from dual;
                   dbms_output.put_line('FacID = ' || v_FacID);
    end;
    /FacID = 99997167
    FacSiteID = 99997167
    FacSiteName = My New Test Facility
    FacID = 99997167
    PL/SQL procedure successfully completed.

  • SOAP scenario "Do not use SOAP Envelope" check problems

    Hi Gurus!
    I'm again here.
    I've an scenario with SOAP Receiver, the WS do I need consume, looks like:
    POST /SumTotalws1/services/Authentication.asmx HTTP/1.1
    Host: xxx.xxx.xxx.xxx
    Content-Type: text/xml; charset=utf-8
    Content-Length: length
    SOAPAction: "http://www.sumtotalsystems.com/sumtotal7/sumtotalws/Authentication/Login"
    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Body>
        <Login xmlns="http://www.sumtotalsystems.com/sumtotal7/sumtotalws/Authentication/">
          <credentials>
            <Username>string</Username>
            <Passcode>string</Passcode>
            <AuthenticationType>NotSpecified or Anonymous or NTAuthentication or Passport or LDAP</AuthenticationType>
            <AccountType>NotSpecified or WebService or WebUI</AccountType>
          </credentials>
        </Login>
      </soap:Body>
    </soap:Envelope>
    but the response looks like:
    HTTP/1.1 200 OK
    Content-Type: text/xml; charset=utf-8
    Content-Length: length
    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Header>
        <UserToken xmlns="http://www.sumtotalsystems.com/sumtotal7/sumtotalws/">
          <Value>string</Value>
        </UserToken>
      </soap:Header>
      <soap:Body>
        <LoginResponse xmlns="http://www.sumtotalsystems.com/sumtotal7/sumtotalws/Authentication/" />
      </soap:Body>
    </soap:Envelope>
    when I create my communication channel with "Do not Use SOAP Envelope" uncheck it, all run ok, but I only get in response message "<LoginResponse>" and I need <UserToken>
    When I check it "Do not use SOAP Envelope" and I use XSLT mapping to add SOAP Env to request message,  I get response message empty.
    I tried the web Service with the message that I obtained from de XSLT mapping in the program SOAPUI. I get ok response with the <UserToken> value.
    some idea to solve this problem??
    Thanks in advance.
    Edited by: KrlosRios on Sep 30, 2011 8:07 PM

    Hi, thanks for your answer.
    Can I use AXIS to execute any WS?
    The WS that I tried execute looks like this:
    POST /xxxx/services/Authentication.asmx HTTP/1.1
    Host: xxx.240.106.39
    Content-Type: text/xml; charset=utf-8
    Content-Length: length
    SOAPAction: "http://xxx/Authentication/Login"
    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Body>
        <Login xmlns="http://xxxxAuthentication/">
          <credentials>
            <Username>string</Username>
            <Passcode>string</Passcode>
            <AuthenticationType>NotSpecified or Anonymous or NTAuthentication or Passport or LDAP</AuthenticationType>
            <AccountType>NotSpecified or WebService or WebUI</AccountType>
          </credentials>
        </Login>
      </soap:Body>
    </soap:Envelope>
    and for the response:
    HTTP/1.1 200 OK
    Content-Type: text/xml; charset=utf-8
    Content-Length: length
    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Header>
        <UserToken xmlns="http://www.sumtotalsystems.com/sumtotal7/sumtotalws/">
          <Value>string</Value>
        </UserToken>
      </soap:Header>
      <soap:Body>
        <LoginResponse xmlns="http://www.sumtotalsystems.com/sumtotal7/sumtotalws/Authentication/"></LoginResponse>
      </soap:Body>
    </soap:Envelope>
    also I found in Trace node in SXI_MONITOR, jus before execute response mapping :
    <Trace level="1" type="B" name="PLSRV_MAPPING_RESPONSE"></Trace><!-- ************************************ -->
    <Trace level="1" type="Timestamp">2011-11-01T19:33:34Z UTC-6 Start of pipeline service processing PLSRVID= PLSRV_MAPPING_RESPONSE</Trace>
    <Trace level="1" type="B" name="CL_XMS_MAIN-CALL_PLSRV">
    <Trace level="3" type="T">Calling pipeline service: PLSRV_MAPPING_RESPONSE</Trace>
    <Trace level="3" type="T">Reading Pipeline-Service specification... </Trace>
    <Trace level="3" type="T">PLSRVTYPE  = </Trace>
    <Trace level="3" type="T">ADRESSMOD  = LOCAL</Trace>
    <Trace level="3" type="T">P_CLASS    = CL_MAPPING_XMS_PLSRV3</Trace>
    <Trace level="3" type="T">P_IFNAME   = IF_XMS_PLSRV</Trace>
    <Trace level="3" type="T">P_METHOD   = ENTER_PLSRV</Trace>
    <Trace level="3" type="T"> </Trace>
    <Trace level="1" type="B" name="CL_XMS_MAIN-CALL_PLSRV_LOCAL"></Trace><!-- ************************************ -->
    <Trace level="1" type="B" name="CL_MAPPING_XMS_PLSRV3-ENTER_PLSRV"></Trace><!-- ************************************ -->
    <Trace level="2" type="T">......attachment XI_Context not found </Trace>
    <Trace level="3" type="T">Das Mapping wurde bereits in der Interface-Ermittlung bestimmt. </Trace>
    <Trace level="3" type="T">Objekt-Id des Interface-Mappings 8594D8C2E6DA3C008F45B112FFCC86B8 </Trace>
    <Trace level="3" type="T">Versions-Id des Interface-Mappings C3BB8FB0A1D511E0A688E9FCB9F06E16 </Trace>
    <Trace level="1" type="T">Interface-Mapping http://xxxxx.net/pi/lms/Authentication OM_LMS_Authentication </Trace>
    <Trace level="3" type="T">Mapping-Schritte 1  XSLT Response_LMS_Auth5 </Trace>
    <Trace level="3" type="T">MTOM-Attachments werden nicht in die Payload überführt. </Trace>
    <Trace level="1" type="T">Payload is empty. </Trace>
    <Trace level="3" type="T">Dynamische Konfiguration ist leer. </Trace>
    <Trace level="2" type="T">Modus 0  </Trace>
    <Trace level="2" type="T">Call XSLT processor with stylsheet Response_LMS_Auth5.xsl. </Trace>
    <Trace level="3" type="T">Method fatalError called, terminate transformation, because of
    Thrown:
    javax.xml.transform.TransformerException: java.io.IOException: Parsing an empty source. Root element expected!
         at com.sap.engine.lib.jaxp.TransformerImpl.transform(TransformerImpl.java:250)
    Say Payload is empty.
    and in left directory tree, not exist "payload" node, only existe SOAP Body and in "Manifest" node looks like this:
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    <!-- XML Validation Outbound Channel Response -->
    <SAP:Manifest wsu:Id="wsuid-manifest-5CABE13F5C59AB7FE10000000A1551F7" xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:wsu="http://www.docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
    <SAP:Payload xlink:href="cid:att-60c3078b066911e1bc1500000093b25a @sap.com">
    <SAP:Name>MainAttachment</SAP:Name><
    SAP:Description>Main document</SAP:Description>
    <SAP:Type>Application</SAP:Type></SAP:Payload>
    </SAP:Manifest>
    Thanks for your help.

  • Using DOM to parse SOAP fault doesn't work properly

    why, when I run the following:
    import java.io.IOException;
    import org.xml.sax.SAXException;
    import org.xml.sax.helpers.DefaultHandler;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.ParserConfigurationException;
    import org.w3c.dom.Document;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    public class ParseFaultDom {
    public void operation(String uri) {
    System.out.println("Parsing XML File: " + uri + "\n\n");
    String faultCode = "";
    String faultString = "";
    try {
    DocumentBuilderFactory factory =
    DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    Document document = builder.parse(uri);
    // should only be one apiece here
    NodeList faultCodes = document.getElementsByTagName("faultcode");
    NodeList faultStrings=document.getElementsByTagName("faultstring");
    Node codeNode = faultCodes.item(0);
    Node stringsNode = faultStrings.item(0);
    faultCode = codeNode.getNodeValue();
    faultString = stringsNode.getNodeValue();
    System.out.println("code: " + faultCode);
    System.out.println("string: " + faultString);
    } catch(ParserConfigurationException e) {
    System.out.println("Error creating parser: " + e.getMessage( ));
    } catch(IOException e) {
    System.out.println("Error reading URI: " + e.getMessage( ));
    } catch (SAXException e) {
    System.out.println("Error in parsing: " + e.getMessage( ));
    public static void main(String[] args) {
    if (args.length != 1) {
    System.out.println("Usage: java ParseFault [XML URI]");
    System.exit(0);
    String uri = args[0];
    ParseFaultDom pfd = new ParseFaultDom();
    pfd.operation(uri);
    giving it the following xml file as input:
    <?xml version='1.0' encoding='UTF-8'?>
    <s:Envelope xmlns:s="http://www.w3.org/2001/06/soap-envelope/"
    xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/1999/XMLSchema">
    <s:Body>
    <s:Fault>
    <faultcode xsi:type="xsd:string">Client</faultcode>
    <faultstring xsi:type="xsd:string">
    Invalid value given for identifier field: "-1".
    </faultstring>
    <details>
    <a>a</a>
    <b>b</b>
    <c>c</c>
    </details>
    </s:Fault>
    </s:Body>
    </s:Envelope>
    do I get the following output:
    Parsing XML File: fault.xml
    code: null
    string: null
    In other words, it finds the tags I'm looking for, but it isn't getting the tag value, apparently.... I can add more instances of each tag, or delete them altogether, and the program raises the appropriate errors.... so it's is finding the tags inside the file, it just apparently doesn't pick up the value for some reason....
    thanks anyone who can help... this should be simple, but it doesn't want to work for me... bad karma?

    First of all, thanks a million for posting replies to my first two posts on these forums, you don't realize how much you have helped me. I feel bad for not assigning duke dollars so you could get them, so I owe you a few :)
    Anyway, I see what was going on now, my thinking was at first that a Node consisted of a tag and it's value, and now I see that those are each a distinct Node element. So now I see that the enclosed text is itself a separate Node object, so I needed to get the child node of codeNode and then call getNodeValue on it to get the text I was looking for... ah, the life of a programmer...
    anyway, thanks again!!!

  • Bug in EWS Java API 1.2: Does not support namespace prefix "s" as in "s:Envelope".. Expects "soap:Envelope"

    It can NOT parse ....
    <?xml version="1.0" encoding="utf-8"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Header><h:ServerVersionInfo MajorVersion="14" MinorVersion="2" MajorBuildNumber="309
    " MinorBuildNumber="3" Version="Exchange2010_SP2" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" xmlns
    :xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"/></s:Header><s:Body><m:GetFolderResponse xmlns:m="http://schemas.microsoft.com/exchange/service
    s/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"><m:ResponseMessages><m:GetFolderResponseMessage ResponseClass="Success"><m:ResponseCode>NoError</m:Respo
    nseCode><m:Folders><t:CalendarFolder><t:FolderId Id="AAMkADExNjY4ZWRmLWIwN2YtNDAxMS05ZjEzLTg3YTRiMjQ0ZGY3ZQAuAAAAAADU0n/e4OgzQYvxnEFT1sxPAQA1LVqe3bVEQ6g4HVLTxYapAFiIzwa6AAA=" ChangeKey="AgA
    AABYAAACUAPkRiik5TYV1B0n4GmWXAAAAAj0P"/><t:ParentFolderId Id="AAMkADExNjY4ZWRmLWIwN2YtNDAxMS05ZjEzLTg3YTRiMjQ0ZGY3ZQAuAAAAAADU0n/e4OgzQYvxnEFT1sxPAQA1LVqe3bVEQ6g4HVLTxYapAFiI0lHWAAA=" Chang
    eKey="AQAAAA=="/><t:FolderClass>IPF.Appointment</t:FolderClass><t:DisplayName>Calendar</t:DisplayName><t:TotalCount>2</t:TotalCount><t:ChildFolderCount>0</t:ChildFolderCount><t:EffectiveRig
    hts><t:CreateAssociated>true</t:CreateAssociated><t:CreateContents>true</t:CreateContents><t:CreateHierarchy>true</t:CreateHierarchy><t:Delete>true</t:Delete><t:Modify>true</t:Modify><t:Rea
    d>true</t:Read><t:ViewPrivateItems>true</t:ViewPrivateItems></t:EffectiveRights><t:PermissionSet><t:CalendarPermissions><t:CalendarPermission><t:UserId><t:DistinguishedUser>Default</t:Disti
    nguishedUser></t:UserId><t:CanCreateItems>false</t:CanCreateItems><t:CanCreateSubFolders>false</t:CanCreateSubFolders><t:IsFolderOwner>false</t:IsFolderOwner><t:IsFolderVisible>false</t:IsF
    olderVisible><t:IsFolderContact>false</t:IsFolderContact><t:EditItems>None</t:EditItems><t:DeleteItems>None</t:DeleteItems><t:ReadItems>TimeOnly</t:ReadItems><t:CalendarPermissionLevel>Free
    BusyTimeOnly</t:CalendarPermissionLevel></t:CalendarPermission><t:CalendarPermission><t:UserId><t:DistinguishedUser>Anonymous</t:DistinguishedUser></t:UserId><t:CanCreateItems>false</t:CanC
    reateItems><t:CanCreateSubFolders>false</t:CanCreateSubFolders><t:IsFolderOwner>false</t:IsFolderOwner><t:IsFolderVisible>false</t:IsFolderVisible><t:IsFolderContact>false</t:IsFolderContac
    t><t:EditItems>None</t:EditItems><t:DeleteItems>None</t:DeleteItems><t:ReadItems>None</t:ReadItems><t:CalendarPermissionLevel>None</t:CalendarPermissionLevel></t:CalendarPermission></t:Cale
    ndarPermissions></t:PermissionSet></t:CalendarFolder></m:Folders></m:GetFolderResponseMessage></m:ResponseMessages></m:GetFolderResponse></s:Body></s:Envelope>
    microsoft.exchange.webservices.data.ServiceRequestException: The request failed. An element node 'soap:Envelope' of the type START_ELEMENT was expected, but node '{http://schemas.xmlsoap.or
    g/soap/envelope/}Envelope' of type START_ELEMENT was found.
            at microsoft.exchange.webservices.data.SimpleServiceRequestBase.internalExecute(SimpleServiceRequestBase.java:51)
            at microsoft.exchange.webservices.data.MultiResponseServiceRequest.execute(MultiResponseServiceRequest.java:142)
            at microsoft.exchange.webservices.data.ExchangeService.bindToFolder(ExchangeService.java:346)
            at microsoft.exchange.webservices.data.ExchangeService.bindToFolder(ExchangeService.java:370)
            at microsoft.exchange.webservices.data.Folder.bind(Folder.java:50)
            at microsoft.exchange.webservices.data.Folder.bind(Folder.java:69)
            at com.tsg.ews.GetItemWorker.run(GetItemWorker.java:252)
            at java.lang.Thread.run(Thread.java:662)
    Caused by: microsoft.exchange.webservices.data.ServiceXmlDeserializationException: An element node 'soap:Envelope' of the type START_ELEMENT was expected, but node '{http://schemas.xmlsoap.
    org/soap/envelope/}Envelope' of type START_ELEMENT was found.
            at microsoft.exchange.webservices.data.EwsXmlReader.internalReadElement(EwsXmlReader.java:114)
            at microsoft.exchange.webservices.data.EwsXmlReader.readStartElement(EwsXmlReader.java:618)
            at microsoft.exchange.webservices.data.ServiceRequestBase.readResponse(ServiceRequestBase.java:450)
            at microsoft.exchange.webservices.data.SimpleServiceRequestBase.readResponse(SimpleServiceRequestBase.java:101)
            at microsoft.exchange.webservices.data.SimpleServiceRequestBase.internalExecute(SimpleServiceRequestBase.java:38)

    After these change still I am getting this kind of Error:
    microsoft.exchange.webservices.data.ServiceRequestException
        at microsoft.exchange.webservices.data.SimpleServiceRequestBase.internalExecute(SimpleServiceRequestBase.java:63)
        at microsoft.exchange.webservices.data.MultiResponseServiceRequest.execute(MultiResponseServiceRequest.java:142)
        at microsoft.exchange.webservices.data.ExchangeService.internalFindFolders(ExchangeService.java:202)
        at microsoft.exchange.webservices.data.ExchangeService.findFolders(ExchangeService.java:257)
        at ci.cryoserver.ews.EWSUtils.testEWSWebService(Unknown Source)
        at org.apache.jsp.save_005fimap_005fmailbox_005freader_005fuserinfo_jsp._jspService(save_005fimap_005fmailbox_005freader_005fuserinfo_jsp.java:453)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at ci.cryoserver.frontend.filter.CompanyTagFilter.doFilter(CompanyTagFilter.java:69)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at ci.cryoserver.ntlm.CryoHttpSecurityFilter.doFilter(CryoHttpSecurityFilter.java:105)
        at ci.cryoserver.ntlm.SSOFilter.doFilter(SSOFilter.java:66)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at ci.cryoserver.ntlm.NTLMPostFilter.doFilter(NTLMPostFilter.java:39)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at ci.cryoserver.frontend.filter.CharsetFilter.doFilter(CharsetFilter.java:152)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)
    Caused by: microsoft.exchange.webservices.data.ServiceXmlDeserializationException: An element node 'soap:Header' of the type START_ELEMENT was expected, but node '{http://schemas.xmlsoap.org/soap/envelope/}Body' of type START_ELEMENT was found.
        at microsoft.exchange.webservices.data.EwsXmlReader.internalReadElement(EwsXmlReader.java:121)
        at microsoft.exchange.webservices.data.EwsXmlReader.readStartElement(EwsXmlReader.java:625)
        at microsoft.exchange.webservices.data.ServiceRequestBase.readSoapHeader(ServiceRequestBase.java:565)
        at microsoft.exchange.webservices.data.ServiceRequestBase.readResponse(ServiceRequestBase.java:525)
        at microsoft.exchange.webservices.data.SimpleServiceRequestBase.readResponse(SimpleServiceRequestBase.java:171)
        at microsoft.exchange.webservices.data.SimpleServiceRequestBase.internalExecute(SimpleServiceRequestBase.java:49)
        ... 40 more
    This Account is working perfectly with autodiscovery mode. any fix for this ?

  • Receiver SOAP : Parsing SOAP Exception

    Hello
    We have a simple scenario SOAP scenario and we are calling backend service in our Receiver SOAP
    It seems that issue is with the SOAP Action.
    Our backend service has multiple SOAP Actions :
    Endpoint  is as follows
    http://serverID/ABCSoftware/ABCdataexchange.asmx
    The SOAP Action is given as follows
    http://ABCSoftware.net/SOAPAction
    We are getting the following error
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Inbound Message
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
      <SAP:Category>XIAdapter</SAP:Category>
      <SAP:Code area="PARSING">ADAPTER.SOAP_EXCEPTION</SAP:Code>
      <SAP:P1 />
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText>soap fault: System.Web.Services.Protocols.SoapException: Server was unable to read request. ---> System.InvalidOperationException: There is an error in XML document (1, 266). ---> System.FormatException: Input string was not in a correct format. at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) at System.Xml.XmlConvert.ToInt32(String s) at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read40_Item(Boolean isNullable, Boolean checkType) at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read141_AllocatedResourceDetails() at Microsoft.Xml.Serialization.GeneratedAssembly.ArrayOfObjectSerializer172.Deserialize(XmlSerializationReader reader) at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events) --- End of inner exception stack trace --- at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events) at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle) at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters() --- End of inner exception stack trace --- at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters() at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()</SAP:AdditionalText>
      <SAP:Stack />
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    We appreciate your assistance with the issue.
    Thanks.
    Kiran

    Hi Kiran
    As you have multiple SOAP action. WSDL can have only one and can be used per communication channel.
    Looking at your error its a XML serialization issue - exception with parser. Your XML input is not correct. If changes are made in your system / target system for the WSDL used. Reimport corrected one and try again
    Thanks
    Gaurav

  • '/soap:Envelope ' in extract throws invalid token error

    I'm receiving xml via webservice/soap and placing in an XMLTYPE table. Upon trying to execute a test query:
    SELECT
    EXTRACTVALUE(VALUE(d),'Destinations/CountryID') AS ID
    FROM X_TEST p,
    TABLE (xmlsequence(EXTRACT(p.object_value,'/soap:Envelope/soap:Body/GetUserDestinationResponse/GetUserDestinationResult/DestinationResults/DestinationsList//Destinations'))) d
    I get an error similar to: (note path here in error is diff than above extract statement)
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00601: Invalid token in: 'soap:Envelope/soap:Body/GetUserDestinationResponse/GetUserDestinationResult/DestinationResults/DestinationsList/Destinations/DestinationList/Destination//Provider'
    Without the soap:Envelope/soap:Body there is no error. Is there a problem using the ':' here?
    Here's a snippet of the stored xml:
    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Body>
    <GetUserDestinationsResponse xmlns="http://xxx.xxx.xxx.xx/somesite_ws/">
    <GetUserDestinationsResult>
    <DestinationResults>
    <DestinationsList>
    <Destinations>
    <CountryID>101</CountryID>
    <CountryDescription>Indonesia</CountryDescription>
    </Destinations>
    </DestinationList>
    </DestinationResults>
    </GetUserDestinationsResult>
    </GetUserDestinationsResponse>
    </soap:Body>
    </soap:Envelope>

    Thanks,
    that set me in the right direction - I had tried the third parm before but must not have been just right being that there are multiple namespaces given. Appears I have to always use the namespace parm to accurately obtain the data. To conclude - this is what I ended up with to get this returning data properly:
    SELECT
    EXTRACTVALUE(VALUE(d),'/Destination/DestinationId', 'xmlns="http://xxx.xxx.xxx.xx/some_ws/"') AS ID,
    Get_Point(EXTRACTVALUE(VALUE(d),'/Destination/Longitude', 'xmlns="http://xxx.xxx.xxx.xx/some_ws/"'),
    EXTRACTVALUE(VALUE(d),'/Destination/Latitude', 'xmlns="http://xxx.xxx.xxx.xx/some_ws/"')) AS geom,
    EXTRACTVALUE(VALUE(p),'/Provider/ProviderName', 'xmlns="http://xxx.xxx.xxx.xx/some_ws/"') AS provider_name,
    EXTRACTVALUE(VALUE(p),'/Provider/ProviderSpecific/HospitalInformation/whoAvainFlu', 'xmlns="http://xxx.xxx.xxx.xx/some_ws/"') AS avaianflu,
    VALUE(p) AS xmlb
    FROM X_MEDAIRE xml
    ,TABLE (xmlsequence(EXTRACT(xml.object_value,
    '/soap:Envelope/soap:Body/*', 'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"'
    ))) e
    ,TABLE (xmlsequence(EXTRACT(VALUE(e),
    '/long/path/after/soap', 'xmlns="http://xxx.xxx.xxx.xx/some_ws/"' ))) d
    ,TABLE (xmlsequence(EXTRACT(VALUE(d),
    '/Destination/ProviderList/Provider', 'xmlns="http://xxx.xxx.xxx.xxx/some_ws/"' ))) p
    WHERE
    EXTRACTVALUE(VALUE(p),'/Provider/ProviderType', 'xmlns="http://xxx.xxx.xxx.xxx/some_ws/"') = 'Hospital'

  • How to parse SOAP XML output and load to oracle9i table

    Below is the SOAP output response and I need to load the data into oracle 9i database tables.
    I am able to parse regular XML without namespaces but unable to parse the data with namespaces.
    I would need help in parsing this XML.
    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
    <s:Header>
    <o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
    <u:Timestamp u:Id="_0">
    <u:Created>2011-11-04T23:16:08.437Z</u:Created>
    <u:Expires>2011-11-04T23:21:08.437Z</u:Expires>
    </u:Timestamp>
    </o:Security>
    </s:Header>
    <s:Body>
    <AssetGetListResponse xmlns="http://dev.services.xerox.com">
    <AssetGetListResult xmlns:a="http://schemas.datacontract.org/2004/07/Xerox.MPS" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
    <a:AssetFeed>
    <a:AccountID>de5862bf-f223-e011-bd3b-0024e861b15c</a:AccountID>
    <a:AccountName>MPS-API Sandbox</a:AccountName>
    <a:AssetID>ecf1545a-f1e9-e011-8a8a-0024e861b15c</a:AssetID>
    <a:AssetNumber>57119B28</a:AssetNumber>
    <a:AssetTag3rdParty i:nil="true"/>
    <a:ChargebackCodeID>1a5962bf-f223-e011-bd3b-0024e861b15c</a:ChargebackCodeID>
    <a:ContractNumber i:nil="true"/>
    <a:ContractTypeDescription i:nil="true"/>
    <a:ControlID i:nil="true"/>
    <a:Group i:nil="true"/>
    <a:GroupID i:nil="true"/>
    <a:InScope>false</a:InScope>
    <a:MACAddress>0000AA713E97</a:MACAddress>
    <a:Manufacturer>Xerox</a:Manufacturer>
    <a:Model>WorkCentre Pro 265</a:Model>
    <a:ModifiedDate>2011-11-02T16:52:12.947Z</a:ModifiedDate>
    <a:PricePlanID>c25a62bf-f223-e011-bd3b-0024e861b15c</a:PricePlanID>
    <a:SerialNumber>UTU101993N</a:SerialNumber>
    <a:VersionNumber>634558495329470000</a:VersionNumber>
    </a:AssetFeed>
    <a:AssetFeed>
    <a:AccountID>de5862bf-f223-e011-bd3b-0024e861b15c</a:AccountID>
    <a:AccountName>MPS-API Sandbox</a:AccountName>
    <a:AssetID>b33b5160-f1e9-e011-8a8a-0024e861b15c</a:AssetID>
    <a:AssetNumber>7EE42ADC</a:AssetNumber>
    <a:AssetTag3rdParty i:nil="true"/>
    <a:ChargebackCodeID>1a5962bf-f223-e011-bd3b-0024e861b15c</a:ChargebackCodeID>
    <a:ContractNumber i:nil="true"/>
    <a:ContractTypeDescription i:nil="true"/>
    <a:ControlID i:nil="true"/>
    <a:Group i:nil="true"/>
    <a:GroupID i:nil="true"/>
    <a:InScope>false</a:InScope>
    <a:MACAddress>0800379B4C2A</a:MACAddress>
    <a:Manufacturer>Xerox</a:Manufacturer>
    <a:Model>WorkCentre 7428</a:Model>
    <a:ModifiedDate>2011-11-02T16:52:14.383Z</a:ModifiedDate>
    <a:PricePlanID>c25a62bf-f223-e011-bd3b-0024e861b15c</a:PricePlanID>
    <a:SerialNumber>PBB015012</a:SerialNumber>
    <a:VersionNumber>634558495343830000</a:VersionNumber>
    </a:AssetFeed>
    </AssetGetListResult>
    </AssetGetListResponse>
    </s:Body>
    </s:Envelope>
    This is what I tried.
    declare
    lp_parser xmlParser.Parser;
    lx_xmldoc xmlDom.DOMDocument;
    ln_doc_node xmlDom.DOMNode;
    lnl_product xmlDom.DOMNodeList;
    lnl_meter xmlDom.DOMNodeList;
    ln_product xmlDom.DOMNode;
    ln_meter xmlDom.DOMNode;
    li_product_cnt NUMBER;
    li_product_max NUMBER;
    li_meter_cnt NUMBER;
    li_meter_max NUMBER;
    lnl_asset_meter_nodes xmldom.DOMNodeList;
    ln_asset_meter_node xmldom.DOMNode;
    ls_batch_number VARCHAR2(30);
    ldt_proc_dt DATE;
    ls_batch_item VARCHAR2(30);
    ls_place_id place.place_id%TYPE;
    ls_product_id product.product_id%TYPE := ' ';
    ls_contract_id contract.contract_id%TYPE;
    li_contract_version contract.contract_version%TYPE;
    li_contract_sequence contr_product.sequence%TYPE;
    ls_meter_id meter_log.meter_id%TYPE;
    ls_read_type meter_log.read_type%TYPE;
    ldt_reading_dt meter_log.reading_dt%TYPE;
    li_meter_value meter_log.meter_value%TYPE;
    li_adjust_copies meter_log.meter_value%TYPE;
    ls_meter_type VARCHAR2(20);
    ls_serial_id product.serial_id%TYPE;
    ls_meter_read_type VARCHAR2(50);
    invalid_parsing EXCEPTION;
    PRAGMA EXCEPTION_INIT(invalid_parsing, -20100);
    BEGIN
    FOR meter_xml_rec IN (SELECT SOAP_RESPONSE
    FROM temp_table
    WHERE call_id=2) LOOP
    lp_parser := xmlparser.newParser;
    xmlparser.parseClob(lp_parser, meter_xml_rec.SOAP_RESPONSE);
    lx_xmldoc := xmlparser.getDocument(lp_parser);
    xmlparser.freeParser(lp_parser);
    ln_doc_node := xmlDom.makeNode(lx_xmldoc);
    ls_batch_number := xslProcessor.valueOf(ln_doc_node, 'AssetGetListResponse/AssetGetListResult/AssetFeed/AccountID');
    lnl_product := xslprocessor.selectNodes(ln_doc_node, 'AssetGetListResponse/AssetGetListResult/a:AssetFeed');
    li_product_max := xmlDom.getLength(lnl_product)-1;
    FOR li_product_cnt IN 0..li_product_max LOOP
    ln_product := xmlDom.item(lnl_product, li_product_cnt);
    ls_batch_item := xslProcessor.valueOf(ln_product, 'AccountName');
    END LOOP;
    END LOOP;
    END;
    OUTPUT:
    =========================================
    3:32:41 PM *
    **3:32:41 PM ORA-20100: Error occurred while processing: Namespace prefix 'a' used but not declared.**
    3:32:41 PM ORA-06512: at "SYS.XSLPROCESSOR", line 22
    3:32:41 PM ORA-06512: at "SYS.XSLPROCESSOR", line 502
    3:32:41 PM ORA-06512: at line 50
    3:32:41 PM *** Script stopped due to error ***
    3:32:41 PM End SQL Editor Execution

    Hi,
    Something like this :
    lnl_product := xslprocessor.selectNodes(
                     ln_doc_node
                   , '/s:Envelope/s:Body/AssetGetListResponse/AssetGetListResult/a:AssetFeed'
                   , 'xmlns:s="http://schemas.xmlsoap.org/soap/envelope/", xmlns="http://dev.services.xerox.com", xmlns:a="http://schemas.datacontract.org/2004/07/Xerox.MPS"'
    li_product_max := xmlDom.getLength(lnl_product)-1;
    FOR li_product_cnt IN 0..li_product_max LOOP
      ln_product := xmlDom.item(lnl_product, li_product_cnt);
      ls_batch_item := xslProcessor.valueOf(ln_product, 'a:AccountName', 'xmlns:a="http://schemas.datacontract.org/2004/07/Xerox.MPS"');
    END LOOP;
    ...Or, using a single query :
    SQL> SELECT extractValue(value(x), '/AssetFeed/AccountID', 'xmlns="http://schemas.datacontract.org/2004/07/Xerox.MPS"') as AccountID
      2       , extractValue(value(x), '/AssetFeed/AccountName', 'xmlns="http://schemas.datacontract.org/2004/07/Xerox.MPS"') as AccountName
      3       , extractValue(value(x), '/AssetFeed/AssetID', 'xmlns="http://schemas.datacontract.org/2004/07/Xerox.MPS"') as AssetID
      4       , extractValue(value(x), '/AssetFeed/AssetNumber', 'xmlns="http://schemas.datacontract.org/2004/07/Xerox.MPS"') as AssetNumber
      5       , extractValue(value(x), '/AssetFeed/SerialNumber', 'xmlns="http://schemas.datacontract.org/2004/07/Xerox.MPS"') as SerialNumber
      6  FROM temp_table t
      7     , TABLE(
      8         XMLSequence(
      9           EXTRACT(
    10             XMLType(t.soap_response)
    11           , '/s:Envelope/s:Body/AssetGetListResponse/AssetGetListResult/a:AssetFeed'
    12           , 'xmlns:s="http://schemas.xmlsoap.org/soap/envelope/", xmlns="http://dev.services.xerox.com", xmlns:a="http://schemas.datacontract.org/2004/07/Xerox.MPS"'
    13           )
    14         )
    15       ) x
    16  WHERE t.call_id = 2
    17  ;
    ACCOUNTID                                      ACCOUNTNAME           ASSETID                                   ASSETNUMBER    SERIALNUMBER
    de5862bf-f223-e011-bd3b-0024e861b15c           MPS-API Sandbox       ecf1545a-f1e9-e011-8a8a-0024e861b15c      57119B28       UTU101993N
    de5862bf-f223-e011-bd3b-0024e861b15c           MPS-API Sandbox       b33b5160-f1e9-e011-8a8a-0024e861b15c      7EE42ADC       PBB015012

  • Parsing Soap Responses

    Hello,
    I am fairly new to CF and am trying to parse and then query a soap response from a third-party api. I have been able to get a response in xml format, but that is where I am stuck. Below the xml response I am getting an error that reads Element.LOGINRESPONSE.LOGINRESULT.XMLTEXT is undefined in LOGINXML.
    I realize my code is a mess, but I am just trying out various things. Does anyone have any insight how to get at the Login Response variable in my soap response so that I can query it?
    Thanks for any insight!!
    <!--- WSDL --->
    <cfset wsdl_url="http://somewebsite/sirewebsvc/sire.asmx?wsdl">
    <cftry>
        <!--- Compose SOAP message to send to Web Service--->
        <cfsavecontent variable="soap"><?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>
                     <Login xmlns="http://www.siretechnologies.com/">
          <LicenseKey>LicenseKey</LicenseKey>
          <Username>username</Username>
          <Password>password</Password>
          <LicenseType>2</LicenseType>
          <APIKey>APIKey</APIKey>
          <SiteKey></SiteKey>
          <CryptKey></CryptKey>
          <WebOnly>false</WebOnly>
        </Login>
                  </soapenv:Body>
              </soapenv:Envelope>
        </cfsavecontent>
            <!--- Invoke web service to send message--->
            <cfhttp url="#wsdl_url#" method="post" >
                <cfhttpparam type="header" name="content-type" value="text/xml">
                <cfhttpparam type="header" name="SOAPAction" value="http://www.siretechnologies.com/Login">
                <cfhttpparam type="header" name="content-length" value="#len(soap)#">
                <cfhttpparam type="header" name="charset" value="utf-8">
                <cfhttpparam type="xml" name="message" value="#trim(soap)#">
            </cfhttp>
    <p><cfoutput>#xmlFormat(cfhttp.fileContent)#</cfoutput> </p>
            <cfset MyXML = XmlParse(CFHTTP.FileContent)>
            XmlSearch(MyXML, "/LoginResponse/LoginResult/")
      <cfcatch type="any">
            <cfdump var="#cfcatch#">
        </cfcatch>
    </cftry>
    <cfsavecontent variable="XMLFile"><?xml version="1.0"?>
    <LoginResponse>
        <LoginResult>
      ???How do I get this from above, or make it a variable???
        </LoginResult>
    </LoginResponse>
    </cfsavecontent>
    <!--- Parse the XML --->
    <cfset MyXMLDoc = xmlParse(XMLFile) />
    <!--- Dump the XML --->
    <h2>Dump</h2>
    <cfdump var="#MyXMLDoc#">
    <cfset MyNodes = xmlSearch(MyXMLDoc,'/LoginResponse/LoginResult')>
    <cfoutput>
        <h2>Nodes</h2>
        <cfloop from="1" to="#arraylen(MyNodes)#" index="i">
            <!--- The array contents need to parsed so you can easily get at the child nodes children and attributes. --->
            <cfset LoginXML = xmlparse(MyNodes[i]) />
            <b>SessionKey:</b> #LoginXML.LoginResponse.LoginResult.xmltext#<br>
        </cfloop>
    </cfoutput>
    --->

    I think I figured it out. Thanks to all who helped!! If anyone is interested, this is how I retrieved the session key from my Soap response.
    <!--- WSDL --->
    <cfset wsdl_url="http://SOMEURL/sire.asmx?wsdl">
        <!--- Compose SOAP message to send to Web Service--->
        <cfsavecontent variable="soap"><?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>
                     <Login xmlns="http://www.siretechnologies.com/">
          <LicenseKey>LicKey</LicenseKey>
          <Username>user</Username>
          <Password>pass</Password>
          <LicenseType>2</LicenseType>
          <APIKey>API</APIKey>
          <SiteKey></SiteKey>
          <CryptKey></CryptKey>
          <WebOnly>false</WebOnly>
        </Login>
                  </soapenv:Body>
              </soapenv:Envelope>
        </cfsavecontent>
            <!--- Invoke web service to send message--->
            <cfhttp url="#wsdl_url#" method="post" >
                <cfhttpparam type="header" name="content-type" value="text/xml">
                <cfhttpparam type="header" name="SOAPAction" value="http://www.siretechnologies.com/Login">
                <cfhttpparam type="header" name="content-length" value="#len(soap)#">
                <cfhttpparam type="header" name="charset" value="utf-8">
                <cfhttpparam type="xml" name="message" value="#trim(soap)#">
            </cfhttp>
            <p><cfoutput>#xmlFormat(cfhttp.fileContent)#</cfoutput> </p>
            <cfset MyXml = XmlParse(cfhttp.fileContent)>
            <cfdump var="#MyXml#">
        <cfset responseNodes = xmlSearch(MyXml,"//*[ local-name() = 'LoginResponse' ]")>
         <cfdump var="#responseNodes#">
        <cfoutput>
    <cfloop from="1" to="#arraylen(responseNodes)#" index="i">
        <cfset TheXML = xmlparse(responseNodes[i])>
        <cfset SesKey = "#TheXML.LoginResponse.LoginResult.XmlText#">
        <b>SessionKey:</b> #TheXML.LoginResponse.LoginResult.XmlText#<br>
        <b>Session Key:#SesKey#
    </cfloop>
    </cfoutput>

  • SOAP envelope XML body extraction

    hello , I'm new in the 'XML-world' and also new on this forum but i have a question.
    My function :
    create or replace
    FUNCTION DHL_SOAP_RESPONSE_XMLTYPE RETURN XMLType AS
    SOAP_RESPONSE constant varchar2(32767) :=
    '<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <SOAP-ENV:Header/>
    <SOAP-ENV:Body>
    <rateresp:RateResponse xmlns:rateresp="http://scxgxtt.phx-dc.dhl.com/euExpressRateBook/RateMsgResponse">
    <Provider code="DHL">
    <Notification code="0">
    <Message/>
    </Notification>
    <Service type="C">
    <TotalNet>
    <Currency>EUR</Currency>
    <Amount>17.28</Amount>
    </TotalNet>
    <Charges>
    <Currency>EUR</Currency>
    <Charge>
    <ChargeType>MEDICAL EXPRESS</ChargeType>
    <ChargeAmount>14.77</ChargeAmount>
    </Charge>
    <Charge>
    <ChargeType>FUEL SURCHARGE</ChargeType>
    <ChargeAmount>2.51</ChargeAmount>
    </Charge>
    </Charges>
    <DeliveryTime>2013-02-06T12:00:00</DeliveryTime>
    <CutoffTime>2013-02-05T20:30:00</CutoffTime>
    <NextBusinessDayInd>N</NextBusinessDayInd>
    </Service>
    <Service type="T">
    <TotalNet>
    <Currency>EUR</Currency>
    <Amount>17.28</Amount>
    </TotalNet>
    <Charges>
    <Currency>EUR</Currency>
    <Charge>
    <ChargeType>EXPRESS 12:00</ChargeType>
    <ChargeAmount>14.77</ChargeAmount>
    </Charge>
    <Charge>
    <ChargeType>FUEL SURCHARGE</ChargeType>
    <ChargeAmount>2.51</ChargeAmount>
    </Charge>
    </Charges>
    <DeliveryTime>2013-02-06T12:00:00</DeliveryTime>
    <CutoffTime>2013-02-05T20:30:00</CutoffTime>
    <NextBusinessDayInd>N</NextBusinessDayInd>
    </Service>
    <Service type="G">
    <TotalNet>
    <Currency/>
    <Amount>0.00</Amount>
    </TotalNet>
    <DeliveryTime>2013-02-06T23:59:00</DeliveryTime>
    <CutoffTime>2013-02-05T20:30:00</CutoffTime>
    <NextBusinessDayInd>N</NextBusinessDayInd>
    </Service>
    <Service type="N">
    <TotalNet>
    <Currency>EUR</Currency>
    <Amount>13.69</Amount>
    </TotalNet>
    <Charges>
    <Currency>EUR</Currency>
    <Charge>
    <ChargeType>DOMESTIC EXPRESS</ChargeType>
    <ChargeAmount>11.70</ChargeAmount>
    </Charge>
    <Charge>
    <ChargeType>FUEL SURCHARGE</ChargeType>
    <ChargeAmount>1.99</ChargeAmount>
    </Charge>
    </Charges>
    <DeliveryTime>2013-02-06T23:59:00</DeliveryTime>
    <CutoffTime>2013-02-05T20:30:00</CutoffTime>
    <NextBusinessDayInd>N</NextBusinessDayInd>
    </Service>
    <Service type="9">
    <TotalNet>
    <Currency/>
    <Amount>0.00</Amount>
    </TotalNet>
    <DeliveryTime>2013-02-07T23:59:00</DeliveryTime>
    <CutoffTime>2013-02-05T16:30:00</CutoffTime>
    <NextBusinessDayInd>N</NextBusinessDayInd>
    </Service>
    </Provider>
    </rateresp:RateResponse>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    BEGIN
    RETURN XMLType(SOAP_RESPONSE);
    END;
    Now what I want is extract the body of the respons with a select .
    Can someone help me because I don't understand this ?
    I work with the Oracle Database XE 11g.
    SQL developer.
    Thanks already

    Welcome to the forums.
    As a tip for future posts [url https://forums.oracle.com/forums/thread.jspa?threadID=2174552#9360002]2. How do I ask a question on the forums?
    That said, a basic example that pulls the contents of the body out is
    declare
      l_ws_rsp    XMLTYPE;
      l_body_rsp  XMLTYPE;
    begin
      -- Retrieving the SOAP message
      l_ws_rsp := DHL_SOAP_RESPONSE_XMLTYPE;
      -- Extracting out the body
      SELECT xt.body_xml
        INTO l_body_rsp
        FROM XMLTable(XMLNamespaces('http://schemas.xmlsoap.org/soap/envelope/' AS "SOAP-ENV"),
                      '/SOAP-ENV:Envelope/SOAP-ENV:Body/*'
                      PASSING l_ws_rsp
                      COLUMNS
                      body_xml   XMLTYPE PATH '.') xt;
       dbms_output.put_line(l_body_rsp.getClobVal());
    end;If you Google
    XMLTable soap site:forums.oracle.com
    you can find plenty of examples on these forums regarding how to parse a web service response.
    The bigger question is, what are you going to do with the data in the response. As the example above alludes too, you can actually parse the entire WS response with one SQL statement and return the results as one or more rows. Will you be performing PL/SQL logic on the returned results or will you simply be INSERTing them into the database for something else to use?

  • Parsing SOAP

    I tried parsing small Soap envelope using KSOAP2 and KXML2 but unfortunately I got an error my code is as follows:
    import java.io.*;
    import javax.microedition.midlet.*;
    import org.ksoap2.SoapEnvelope;
    import org.kxml2.io.KXmlParser;
    import org.xmlpull.v1.XmlPullParserException;
    import java.io.ByteArrayInputStream;
    * @author Welcome
    public class MobileSOAPParsingMidlet extends MIDlet {
    String msg1="<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"> <S:Header/>" +
    " <S:Body> <ns2:Add xmlns:ns2=\"http://webservice/\"> <x>5</x>" +
    " <y>8</y> </ns2:Add> </S:Body></S:Envelope>";
    String msg2 = " <Envelope Version= \"1\"> <Body>      <WebService>          <Action>Add</Action>               <x>5</x>          <y>8</y>          </WebService> </Body></Envelope>";
    // "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
    String msg = "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" " +
    " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " +
    " xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">\n" +
    " <getRating xmlns=\"http://tempuri.org\">\n" +
    " </getRating>\n" +
    " </soap:Body>\n" +
    "</soap:Envelope>";
    public void startApp() {
    byte[] xmlByteArray = msg.getBytes();
    ByteArrayInputStream xmlStream = new ByteArrayInputStream( xmlByteArray );
    InputStreamReader xmlReader = new InputStreamReader( xmlStream );
    KXmlParser parser = new KXmlParser();
    try {
    parser.setInput(xmlStream, msg);
    } catch (XmlPullParserException ex) {
    ex.printStackTrace();
    SoapEnvelope soapenvelope=new SoapEnvelope(SoapEnvelope.VER12);
    try {
    soapenvelope.parse(parser);
    } catch (IOException ex) {
    ex.printStackTrace();
    } catch (XmlPullParserException ex) {
    ex.printStackTrace();
    // catch(UnsupportedEncodingException e){
    // System.err.println(e);
    public void pauseApp() {
    public void destroyApp(boolean unconditional) {
    the error is Invalid stream or encoding: java.io.UnsupportedEncodingException: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <getRating xmlns="http://tempuri.org">
    </getRating>
    </soap:Body>
    </soap:Envelope> (position:START_DOCUMENT null@0:0) caused by: java.io.UnsupportedEncodingException: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <getRating xmlns="http://tempuri.org">
    </getRating>
    </soap:Body>
    </soap:Envelope>; nested exception is:
    java.io.UnsupportedEncodingException: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <getRating xmlns="http://tempuri.org">
    </getRating>
    </soap:Body>
    </soap:Envelope>
    at com.sun.kvem.cldc.i18n.j2me.GenericReader.<init>(GenericReader.java:46)
    at com.sun.cldc.i18n.Helper.getStreamReaderPrim(Helper.java:152)
    at com.sun.cldc.i18n.Helper.getStreamReader(Helper.java:107)
    at java.io.InputStreamReader.<init>(+10)
    at org.kxml2.io.KXmlParser.setInput(+563)
    at MobileSOAPParsingMidlet.startApp(MobileSOAPParsingMidlet.java:38)
    at javax.microedition.midlet.MIDletProxy.startApp(MIDletProxy.java:43)
    at com.sun.midp.midlet.Scheduler.schedule(Scheduler.java:374)
    at com.sun.midp.main.Main.runLocalClass(Main.java:466)
    at com.sun.midp.main.Main.main(Main.java:120)
    org.xmlpull.v1.XmlPullParserException: No Input specified (position:START_DOCUMENT null@0:0)
    at org.kxml2.io.KXmlParser.exception(+47)
    at org.kxml2.io.KXmlParser.nextImpl(+13)
    at org.kxml2.io.KXmlParser.next(+23)
    at org.kxml2.io.KXmlParser.nextTag(+4)
    at org.ksoap2.SoapEnvelope.parse(+6)
    at MobileSOAPParsingMidlet.startApp(MobileSOAPParsingMidlet.java:44)
    at javax.microedition.midlet.MIDletProxy.startApp(MIDletProxy.java:43)
    at com.sun.midp.midlet.Scheduler.schedule(Scheduler.java:374)
    at com.sun.midp.main.Main.runLocalClass(Main.java:466)
    at com.sun.midp.main.Main.main(Main.java:120

    I am currently replacing my Oracle software with a newer version and therefor without a database so I can't give you a proper example, BUT to give you a hint, you leftout the namespace references in EXTRACT and EXTRACTVALUE. It could be that you need multiple namespace declarations, but I can't check it now to give you the proper example. It should be something along the lines like the following.
    SELECT EXTRACT(a.col1,'//Response/Result/text()', 'xmlns="http://myhost/myhostcomm"').getStringVal() "Ext",
    EXTRACTVALUE(a.col1,'//Response/@Result','xmlns="http://myhost/myhostcomm"') "ExtVal"
    FROM XML_test a
    / DO NOT USE //, it will cost you dearly regarding performance, BE PRECISE...!

  • Parsing SOAP Results into Variables

    Can someone assist me in figuring out what way I need to go
    to parse SOAP results into an array?
    I have setup the <MX:WEBService> correctly, created my
    resultEvent(event) handler and faultEvenet(event) handler as
    needed. Below is the web service:
    <mx:WebService
    id="srvGetTagHistory" wsdl="{SOAP_URL}"
    result="CreateTagHistory(event)" fault="faultEvenet(event)"
    useProxy="false">
    <mx:operation name="GetTagHistory" resultFormat="e4x">
    <mx:request>
    <RSWID>{vRSWID}</RSWID>
    </mx:request>
    </mx:operation>
    </mx:WebService>
    This works perfectly. I can return the results of the
    webservice to a text area control, and the complete SOAP results
    are displayed.
    My problem is I cannot and have not figured out how to make
    the SOAP results into some type of arraycollection for using in,
    lets say, a dataGrid.
    Here is an example of a SOAP result for the above webservice:
    <NS1:GetTagHistoryResponse
    xmlns:NS1="urn:myresaleworldserviceIntf-myresaleworldserver"
    xmlns:NS2="urn:myresaleworldserviceIntf" xmlns:SOAP-ENV="
    http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsd="
    http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="
    http://www.w3.org/2001/XMLSchema-instance"
    xmlns:SOAP-ENC="
    http://schemas.xmlsoap.org/soap/encoding/">
    <NS2:return href="#1"/>
    <SOAP-ENC:Array id="1">
    <item href="#2"/>
    <item href="#9"/>
    <item href="#16"/>
    <item href="#25"/>
    <item href="#29"/>
    </SOAP-ENC:Array>
    <NS2:rswTagHistory id="2">
    <OrderDate>2005-12-08T11:15:24.857-05:00</OrderDate>
    <TagType>CB Tags</TagType>
    <NS2:ColorDetail href="#3"/>
    </NS2:rswTagHistory>
    <SOAP-ENC:Array id="3">
    <item href="#4"/>
    <item href="#5"/>
    <item href="#6"/>
    <item href="#7"/>
    <item href="#8"/>
    </SOAP-ENC:Array>
    <NS2:rswTagColorDetail id="4">
    <TagColor>Lavender</TagColor>
    <Total>2</Total>
    </NS2:rswTagColorDetail>
    <NS2:rswTagColorDetail id="5">
    <TagColor>Light Blue</TagColor>
    <Total>2</Total>
    </NS2:rswTagColorDetail>
    <NS2:rswTagColorDetail id="6">
    <TagColor>Green</TagColor>
    <Total>2</Total>
    </NS2:rswTagColorDetail>
    <NS2:rswTagColorDetail id="7">
    <TagColor>Pink</TagColor>
    <Total>2</Total>
    </NS2:rswTagColorDetail>
    <NS2:rswTagColorDetail id="8">
    <TagColor>Yellow</TagColor>
    <Total>1</Total>
    </NS2:rswTagColorDetail>
    <NS2:rswTagHistory id="9">
    <OrderDate>2005-12-08T11:18:44.233-05:00</OrderDate>
    <TagType>CB Tags</TagType>
    <NS2:ColorDetail href="#10"/>
    </NS2:rswTagHistory>
    <SOAP-ENC:Array id="10">
    <item href="#11"/>
    <item href="#12"/>
    <item href="#13"/>
    <item href="#14"/>
    <item href="#15"/>
    </SOAP-ENC:Array>
    <NS2:rswTagColorDetail id="11">
    <TagColor>Lavender</TagColor>
    <Total>2</Total>
    </NS2:rswTagColorDetail>
    <NS2:rswTagColorDetail id="12">
    <TagColor>Light Blue</TagColor>
    <Total>3</Total>
    </NS2:rswTagColorDetail>
    <NS2:rswTagColorDetail id="13">
    <TagColor>Green</TagColor>
    <Total>2</Total>
    </NS2:rswTagColorDetail>
    <NS2:rswTagColorDetail id="14">
    <TagColor>Pink</TagColor>
    <Total>3</Total>
    </NS2:rswTagColorDetail>
    <NS2:rswTagColorDetail id="15">
    <TagColor>Yellow</TagColor>
    <Total>2</Total>
    </NS2:rswTagColorDetail>
    <NS2:rswTagHistory id="16">
    <OrderDate>2006-08-07T13:56:22.513-05:00</OrderDate>
    <TagType>CB Tags</TagType>
    <NS2:ColorDetail href="#17"/>
    </NS2:rswTagHistory>
    <SOAP-ENC:Array id="17">
    <item href="#18"/>
    <item href="#19"/>
    <item href="#20"/>
    <item href="#21"/>
    <item href="#22"/>
    <item href="#23"/>
    <item href="#24"/>
    </SOAP-ENC:Array>
    <NS2:rswTagColorDetail id="18">
    <TagColor>Lavender</TagColor>
    <Total>2</Total>
    </NS2:rswTagColorDetail>
    <NS2:rswTagColorDetail id="19">
    <TagColor>Light Blue</TagColor>
    <Total>2</Total>
    </NS2:rswTagColorDetail>
    <NS2:rswTagColorDetail id="20">
    <TagColor>Green</TagColor>
    <Total>2</Total>
    </NS2:rswTagColorDetail>
    <NS2:rswTagColorDetail id="21">
    <TagColor>Orange</TagColor>
    <Total>2</Total>
    </NS2:rswTagColorDetail>
    <NS2:rswTagColorDetail id="22">
    <TagColor>Pink</TagColor>
    <Total>1</Total>
    </NS2:rswTagColorDetail>
    <NS2:rswTagColorDetail id="23">
    <TagColor>Red</TagColor>
    <Total>2</Total>
    </NS2:rswTagColorDetail>
    <NS2:rswTagColorDetail id="24">
    <TagColor>Yellow</TagColor>
    <Total>1</Total>
    </NS2:rswTagColorDetail>
    <NS2:rswTagHistory id="25">
    <OrderDate>2007-04-10T12:08:03.950-05:00</OrderDate>
    <TagType>CB Tags</TagType>
    <NS2:ColorDetail href="#26"/>
    </NS2:rswTagHistory>
    <SOAP-ENC:Array id="26">
    <item href="#27"/>
    <item href="#28"/>
    </SOAP-ENC:Array>
    <NS2:rswTagColorDetail id="27">
    <TagColor>Light Blue</TagColor>
    <Total>3</Total>
    </NS2:rswTagColorDetail>
    <NS2:rswTagColorDetail id="28">
    <TagColor>Green</TagColor>
    <Total>1</Total>
    </NS2:rswTagColorDetail>
    <NS2:rswTagHistory id="29">
    <OrderDate>2007-12-19T12:52:30.883-05:00</OrderDate>
    <TagType>Thermal Tags</TagType>
    <NS2:ColorDetail href="#30"/>
    </NS2:rswTagHistory>
    <SOAP-ENC:Array id="30"/>
    </NS1:GetTagHistoryResponse>
    Any assistance to this issue would be greatly appreciated.

    If you have set resultFormat="e4x" than you can handle the
    result very easily.
    I guess you already find out that your result is in
    event.result.
    Your example is too hard to parse by human.
    You can read:
    http://livedocs.adobe.com/labs/flex3/html/help.html?content=13_Working_with_XML_01.html
    Especially: Traversing XML structures and Using XML
    namespaces
    I hope this will help

  • Unable to parse soap fault due to SOAP version

    The business logic deployed to my Weblogic server invokes a 3rd party web service. When the 3rd party web service throws a soap fault, the web service client fails to parse it:
    SOAPFaultException - FaultCode [[http://schemas.xmlsoap.org/soap/envelope/]env.Server <http://schemas.xmlsoap.org/soap/envelope/%5denv.Server> <http://schemas.xmlsoap.org/soap/envelope/%5denv.Server> ] FaultString [RMSX1000:An unrecoverable system error has occured. please contact RMS support at [email protected] Message > [0]. [ java.rmi.RemoteException: /app/bea103/user_projects/domains/novella/<unknown>:0: error: com.bea.xml.XmlException: java.lang.IllegalArgumentException nested exception is:
    com.bea.xml.XmlRuntimeException: /app/bea103/user_projects/domains/novella/<unknown>:0: error: com.bea.xml.XmlException: java.lang.IllegalArgumentException:/app/bea103/user_projects/domains/novella/<unknown>:0: error: com.bea.xml.XmlException: java.lang.IllegalArgumentException nested exception is:
    com.bea.xml.XmlRuntimeException: /app/bea103/user_projects/domains/novella/<unknown>:0: error: com.bea.xml.XmlException: java.lang.IllegalArgumentException ]] FaultActor [NO ACTOR] Detail [<detail>
    I used a network packet analyzer and found out that the soap fault structure is different as the 3rd party use the soap 1.1 implementation which has a different structure. My question is how do I generate the client stubs for a specific version (as currently they appear to be generated for Soap 1.2)? I reviewed the clientgen Ant task documentation and found no clue.
    I think I may try to use stub._setProperty(WLStub.CONVERSATION_VERSION_PROPERTY, WLStub.CONVERSATION_VERSION_ONE) or some of its properties and see it that works - documentation is unclear.
    Edited by: user8651233 on Oct 15, 2009 1:02 PM

    I used a network packet analyzer and found out that the soap fault structure is different as the 3rd party use the soap 1.1 implementation which has a different structureAre you using soap 1.1 when you invoke the service?

  • "Error while parsing SOAP XML payload: no element found" received when invoking Web Service

    Running PB 12.1 Build 7000.  Using Easysoap.  Error ""Error while parsing SOAP XML payload: no element found" received when invoking Web Service".  This error does not appear to be coming from the application code.  Noticed that there were some erroneous characters showing up within the header portion of the XML ("&Quot;").  Not sure where these are coming from.  When I do a find within the PB code for ""&quot;" it gets located within two objects, whereas they both reference a "temp_xml_letter".  Not sure where or what temp_xml_letter resides???   The developer of this is no longer with us and my exposure to WSDL and Web Services is rather limited.  Need to get this resolved...please.
    This is the result of the search.  Notice the extraneous characters ("&quot;"):
    dar1main.pbl(d_as400_mq_xml)
    darlettr.pbl(d_email_xml)
    ---------- Search: Searching Target darwin for 'temp_xml'    (9:52:41 AM)
    ---------- 2 Matches Found On "temp_xml":
    dar1main.pbl(d_as400_mq_xml).d_as400_mq_xml:  export.xml(usetemplate="temp_xml_letter" headgroups="1" includewhitespace="0" metadatatype=0 savemetadata=0  template=(comment="" encoding="UTF-8" name="temp_xml_letter" xml="<?xml version=~"1.0~" encoding=~"UTF-16LE~" standalone=~"yes~"?><EmailServiceTransaction xmlns=~"http://xml.xxnamespace.com/Utility/Email/EmailService" ~" xmlns:imc=~"http://xml.xxnamespace.com/IMC~" xmlns:xsi=~"http://www.w3.org/2001/XMLSchema-instance~" xmlns:root=~"http://xml.xxnamespace.com/RootTypes~" xmlns:email=~"http://xml.xxnamespace.com/Utility/Email~" xsi:schemaLocation=~"http://xml.xxnamespace.com/Utility/Email/EmailService http://dev.xxnamespace.com/Utility/Email/EmailService/V10-TRX-EmailService.xsd~"><EmailServiceInformation><EmailServiceDetail __pbband=~"detail~"><ApplicationIdentifier> applicationidentifier </ApplicationIdentifier><AddresseeInformation><AddresseeDetail><Number> number </Number></AddresseeDetail></AddresseeInformation><EmailMessageInformation><Ema
    darlettr.pbl(d_email_xml).d_email_xml:  export.xml(usetemplate="temp_xml_letter" headgroups="1" includewhitespace="0" metadatatype=0 savemetadata=0  template=(comment="" encoding="UTF-8" name="temp_xml_letter" xml="<?xml version=~"1.0~" encoding=~"UTF-16LE~" standalone=~"yes~"?><EmailServiceTransaction xmlns=~"http://xml.xxnamespace.com/Utility/Email/EmailService" ~" xmlns:imc=~"http://xml.xxnamespace.com/IMC~" xmlns:xsi=~"http://www.w3.org/2001/XMLSchema-instance~" xmlns:root=~"http://xml.xxnamespace.com/RootTypes~" xmlns:email=~"http://xml.xxnamespace.com/Utility/Email~" xsi:schemaLocation=~"http://xml.xxnamespace.com/Utility/Email/EmailService http://dev.xxnamespace.com/Utility/Email/EmailService/V10-TRX-EmailService.xsd~"><EmailServiceInformation><EmailServiceDetail __pbband=~"detail~"><ApplicationIdentifier> applicationidentifier </ApplicationIdentifier><AddresseeInformation><AddresseeDetail><Number> imcnumber </Number></AddresseeDetail></AddresseeInformation><EmailMessageInformation><Ema
    ---------- Done 2 Matches Found On "temp_xml":
    ---------- Finished Searching Target darwin for 'temp_xml'    (9:52:41 AM)

    Maybe "extraneous" is an incorrect term.  Apparantly, based upon the writeup within Wiki, the parser I am using does not interpret the "&quot;"?  How do I find which parser is being utilized and how to control it?
    <<<
    If the document is read by an XML parser that does not or cannot read external entities, then only the five built-in XML character entities (see above) can safely be used, although other entities may be used if they are declared in the internal DTD subset.
    If the document is read by an XML parser that does read external entities, then the five built-in XML character entities can safely be used. The other 248 HTML character entities can be used as long as the XHTML DTD is accessible to the parser at the time the document is read. Other entities may also be used if they are declared in the internal DTD subset.
    >>>

Maybe you are looking for