Xml reading Strings

Hi there,
Im struggling to find a way to read XML data from a sting, the xml parse doesnt accept strings only files, inputssoures ect..
Is there a way to do this,
Also how can i send a file over SOAP?
Thanks
Robert

Thanks DrClap,
that was the problem, having not worked with StAX before I didn't know it could behave like this :(
So I had a look at the documentation and tried setting the IS_COALESCING property but it seems the implementation of StAX that we have doesn't support this :( and doesn't have the methods isCoalescing :( and I don't have enough influence to change that.
So I have had to set up my looping through events like the following pseudo code :
if event != CHARACTERS && stringBuffer.length > 0
process characters
make stringBuffer empty
do some event processing
if event == CHARACTERS
add the characters to the string buffer
If there is a better way of doing this I'd like to know but at least I have something that works at the moment.
Thanks
Rob

Similar Messages

  • Error: unexpected XML reader state. expected: END but found: START:

    I am getting following error while invoking method 'GetVersionInfo' (.net web service over dll) which takes one input parameter(string) and gives two output parameters(both short):
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception: deserialization
    error: unexpected XML reader state. expected: END but found: START:
    {UPPLink}pnVersionMajor
    ORA-06512: at "SYS.UTL_DBWS", line 388
    ORA-06512: at "SYS.UTL_DBWS", line 385
    ORA-06512: at line 40
    Expected Request is as follows:
    POST /UPPLink/UPPLink.asmx HTTP/1.1
    Host: 172.16.1.38
    Content-Type: text/xml; charset=utf-8
    Content-Length: length
    SOAPAction: "UPPLink/GetVersionInfo"
    <?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>
    <GetVersionInfo xmlns="UPPLink">
    <ignore>string</ignore>
    </GetVersionInfo>
    </soap:Body>
    </soap:Envelope>
    EXpected Response is as follows:
    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:Body>
    <GetVersionInfoResponse xmlns="UPPLink">
    <GetVersionInfoResult>
    <pnVersionMajor>short</pnVersionMajor>
    <pnVersionMinor>short</pnVersionMinor>
    </GetVersionInfoResult>
    </GetVersionInfoResponse>
    </soap:Body>
    </soap:Envelope>
    The PL/SQL code I am using is as follows:
    DECLARE
    service_ sys.utl_dbws.SERVICE;
    call_ sys.UTL_DBWS.call;
    service_qname sys.utl_dbws.QNAME;
    port_qname sys.utl_dbws.QNAME;
    operation_qname sys.utl_dbws.QNAME;
    string_type_qname sys.utl_dbws.QNAME;
    number_type_qname sys.utl_dbws.QNAME;
    retx ANYDATA;
    strEntry VARCHAR2(100);
    retx_string VARCHAR2(100);
    majorVersion NUMBER;
    minorVersion NUMBER;
    params sys.utl_dbws.ANYDATA_LIST;
    v_outputs sys.utl_dbws.anydata_list;
    BEGIN
    dbms_output.put_line('Starting Function');
    service_qname := sys.utl_dbws.to_qname(null, 'UPPLink');
    strEntry := 'vab';
    dbms_output.put_line('Creating Service');
    service_ := sys.utl_dbws.create_service(HTTPURITYPE('http://172.16.1.38/UPPLink/UPPLink.asmx?WSDL'), service_qname);
    dbms_output.put_line('Creating Operation');
    operation_qname := sys.utl_dbws.to_qname(null, 'GetVersionInfo');
    dbms_output.put_line('Calling Service');
    call_ := sys.utl_dbws.create_call(service_, null, operation_qname);
    sys.utl_dbws.set_property(call_, 'SOAPACTION_USE', 'true');
    sys.utl_dbws.set_property(call_, 'SOAPACTION_URI', 'UPPLink/GetVersionInfo');
    sys.utl_dbws.set_property(call_, 'OPERATION_STYLE', 'rpc');
    string_type_qname := sys.utl_dbws.to_qname('http://www.w3.org/2001/XMLSchema', 'string');
    number_type_qname := sys.utl_dbws.to_qname('http://www.w3.org/2001/XMLSchema', 'short');
    sys.utl_dbws.add_parameter(call_, 'ignore', string_type_qname, 'ParameterMode.IN');
    sys.utl_dbws.add_parameter(call_, 'pnVersionMinor', number_type_qname, 'ParameterMode.OUT');
    sys.utl_dbws.set_return_type(call_, number_type_qname);
    params(0) := ANYDATA.convertvarchar2(strEntry);
    dbms_output.put('Invoking with Input Parameter: ');
    dbms_output.put_line(ANYDATA.ACCESSVARCHAR2(params(0)));
    retx := sys.utl_dbws.invoke(call_, params);
    dbms_output.put_line('Invoke complete');
    majorVersion := retx.accessnumber;
    dbms_output.put_line('Major Version ' || majorVersion);
    v_outputs := SYS.utl_dbws.get_output_values(call_);
    minorVersion := ANYDATA.AccessNumber(v_outputs(1));
    dbms_output.put_line('Minor Version ' || minorVersion);
    sys.utl_dbws.release_service(service_);
    END;
    /

    Actually, the name needs to match what is specified in the WSDL file.

  • Xerces - Parse XML from String

    I am trying to parse an xml string using Xerces.
    I have the following code:
    String xml = <segments meters="8643" seconds="538" distance="5.4 mi" time="8 mins"><segment id="seg0"  pointIndex="0" meters="122" seconds="11"  distance="0.1 mi"  time="11 secs">Head  <b>southwest</b> from <b>B Ave NE</b>
    </segment>
    <segment id="seg1" pointIndex="2" meters="239" seconds="22" distance="0.1 mi" time="21 secs">Turn <b>left</b> at <b>19th St NE</b></segment>
    <segment id="seg2" pointIndex="5" meters="2985" seconds="192" distance="1.9 mi" time="3 mins">Turn <b>right</b> at <b>1st Ave NE</b></segment>
    <segment id="seg3" pointIndex="43" meters="3280" seconds="211" distance="2.0 mi" time="3 mins">Continue on <b>1st Ave SW/1st Ave NW</b></segment>
    <segment id="seg4" pointIndex="96" meters="158" seconds="10" distance="0.1 mi" time="10 secs">Bear <b>right</b> at <b>US-151-BR S</b></segment>
    <segment id="seg5" pointIndex="102" meters="1859" seconds="93" distance="1.2 mi" time="1 min">Turn <b>right</b> at <b>16th Ave SW</b></segment>;
    XMLReader reader = new SAXParser();
    reader.setContentHandler(new Handler());
    reader.parse(xml);I am getting the followoing error:
    org.xml.sax.SAXParseException: File "<segments meters="8643" seconds="538" distance="5.4 mi" time="8 mins"><segment id="seg0" pointIndex="0" meters="122" seconds="11" distance="0.1 mi" time="11 secs">Head  <b>southwest</b> from <b>B Ave NE</b></segment><segment id="seg1" pointIndex="2" meters="239" seconds="22" distance="0.1 mi" time="21 secs">Turn <b>left</b> at <b>19th St NE</b></segment><segment id="seg2" pointIndex="5" meters="2985" seconds="192" distance="1.9 mi" time="3 mins">Turn <b>right</b> at <b>1st Ave NE</b></segment><segment id="seg3" pointIndex="43" meters="3280" seconds="211" distance="2.0 mi" time="3 mins">Continue on <b>1st Ave SW/1st Ave NW</b></segment><segment id="seg4" pointIndex="96" meters="158" seconds="10" distance="0.1 mi" time="10 secs">Bear <b>right</b> at <b>US-151-BR S</b></segment><segment id="seg5" pointIndex="102" meters="1859" seconds="93" distance="1.2 mi" time="1 min">Turn <b>right</b> at <b>16th Ave SW</b></segment></segments>" not found.
         at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1219)
         at org.apache.xerces.readers.DefaultEntityHandler.startReadingFromDocument(DefaultEntityHandler.java:501)
         at org.apache.xerces.framework.XMLParser.parseSomeSetup(XMLParser.java:314)
         at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1097)
         at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1139)
         at com.shiftyeyes.xmlTest.main(xmlTest.java:34)
    Exception in thread "main" anyone know how I can fix this? Thanks!!

    reader.parse(new InputSource(new StringReader(xml)));

  • How to Parse XML into String in BPEL?

    Hi,
    Can anyone tell me, how can I parse XML into String?
    I am taking input from File Adapter, File adapter is reading that XML.
    Then in assign activity i am using XPath expression(built functions) using XMLParser(),doTranslateToNative() etc.. many functions I have tried but XML is not getting parsed into String Variable.
    Please help me asap.
    Thanks
    Shikha

    Thanks a lot Eric.
    I am trying this, oraext:get-content-as-string('receiveInput_Read_InputVariable','body','/ns3:orders')
    but getting this error
    <bpelFault><faultType>0</faultType><subLanguageExecutionFault xmlns="http://schemas.oracle.com/bpel/extension"><part name="summary"><summary>XPath expression failed to execute. An error occurs while processing the XPath expression; the expression is oraext:get-content-as-string('receiveInput_Read_InputVariable','body','/ns3:orders'). The XPath expression failed to execute; the reason was: internal xpath error. Check the detailed root cause described in the exception message text and verify that the XPath query is correct. </summary></part><part name="code"><code>XPathExecutionError</code></part></subLanguageExecutionFault></bpelFault>

  • Creating a Function module to send XML Byte String

    Hi all,
    I have to create a Function module to get XML byte string.The internal table is dynamic coloums based on how many data selected as a importparameter.from the internal; table data I have to create a XML byte string as a output.Pl help me to proceed further.
    Thanks in Advance.
    Ram

    If i have your question right you need to convert an internal table of unknown type to an xml string then to a byte string.
    data xmlString type string.
    data xmlXString type xstring.
    call transformation id
       source
          table = internalTableYouWantToExport
       result
          xml xmlString.
    export xmlString to data buffer xmlXString.
    xmlString has the xml of the table and xmlXString contains the byte representation of the string.

  • Deserialization error: XML reader error: unexpected character content:

    Hi,
    I'm just learning to write web services. I pasted the service and it seems to work.
    It's code is :
    package server;
    import javax.jws.WebService;
    public class HelloImpl {
       * @param name
       * @return Say hello to the person.
       public String sayHello(String name) {
         return "Hello, " + name + "!";
    }I wired the service using spring, following the tutorial :
    public class HellowsImpl {
        String name;
        public HellowsImpl() {
        private Hellows service;
        public void setService(Hellows service) {
            this.service = service;
        public void sayHi() {
            try {
                service.sayHello(name);
            } catch (RemoteException e) {
                // TODO
        public Hellows getService() {
            return service;
        public void setName(String name) {
            this.name = name;
    }But when I try this :     HellowsImpl service ;
        service=(HellowsImpl)ac.getBean("hellowsclient");
    service.sayHi();I get the exception : Caught exception while handling request: deserialization error: XML reader error: unexpected character content: "fd"
    Where might be the problem?

    Hi, I am also facing this error while trying to create "Dynamic Proxy Client"
    I am accessing the WS method like this
    String UrlString = "http://localhost:1559/DynamicProxy/DProxy?WSDL";
    String nameSpace = "urn:DProxy/wsdl";
    String serviceName = "DProxy";
    String port = "DProxySEIPort";
    URL serviceUrl = new URL(UrlString);
    ServiceFactory serviceFactory = ServiceFactory.newInstance();
    Service service = serviceFactory.createService(serviceUrl,new QName(nameSpace,serviceName));
    dproxy.DProxySEI myProxy = (dproxy.DProxySEI)service.getPort(new QName(nameSpace,port),dproxy.DProxySEI.class);
    String message = myProxy.sayHello("rajeev");
    WSDL File content :
    <?xml version="1.0" encoding="UTF-8"?><definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="urn:DProxy/wsdl" xmlns:ns2="urn:DProxy/types" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" name="DProxy" targetNamespace="urn:DProxy/wsdl">
    <types>
    <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="urn:DProxy/types" xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="urn:DProxy/types">
    <complexType name="sayHello">
    <sequence>
    <element name="String_1" type="string" nillable="true"/></sequence></complexType>
    <complexType name="sayHelloResponse">
    <sequence>
    <element name="result" type="string" nillable="true"/></sequence></complexType>
    <element name="sayHello" type="tns:sayHello"/>
    <element name="sayHelloResponse" type="tns:sayHelloResponse"/></schema></types>
    <message name="DProxySEI_sayHello">
    <part name="parameters" element="ns2:sayHello"/></message>
    <message name="DProxySEI_sayHelloResponse">
    <part name="result" element="ns2:sayHelloResponse"/></message>
    <portType name="DProxySEI">
    <operation name="sayHello">
    <input message="tns:DProxySEI_sayHello"/>
    <output message="tns:DProxySEI_sayHelloResponse"/></operation></portType>
    <binding name="DProxySEIBinding" type="tns:DProxySEI">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
    <operation name="sayHello">
    <soap:operation soapAction=""/>
    <input>
    <soap:body use="literal"/></input>
    <output>
    <soap:body use="literal"/></output></operation></binding>
    <service name="DProxy">
    <port name="DProxySEIPort" binding="tns:DProxySEIBinding">
    <soap:address location="http://localhost:1559/DynamicProxy/DProxy" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"/></port></service></definitions>
    and Here is my SEI Implementation class
    public java.lang.String sayHello(String name) throws java.rmi.RemoteException {
    String message = "hi.."+name+"..How r u";
    return message;
    Can any one help me plz...
    Thanks in advance..

  • XML Input String too long to Test Web Service in App Server

    We have a Web Service that accepts an XML input string but when we deploy this web service and try to test it through the Application Server it errors out because the input string is too long. Is there any way around this??
    Thanks...

    Update:
    Now I see that there are in fact two error messages. The second one is the one presented above. But the first one says:
    Line: 145
    Char: 97
    Error: Expected ';'
    Code: 0
    My question now is to what file it is referring?? Is it to ProjectAccountingPort.js that is automatically created? THen why is it not properly created??
    Please, please help me with this! The deadline is in a few days...

  • Parse XML formatted String

    Hi All,
       I have a string field that is formatted in XML format. What I want to be able to do is pull a specific element from the xml formatted string.
    Example string:
    <customer><name>john</name><id>25636</id></customer>
    I want to retreive just the id number of 25636 from this string.
    I would I go about accomplishing this?
    Thank you in advance,

    I fixed it on my own.
    Here' s my answer for others that may need it:
    if(instr({field.xmlstring},'</id>')  - instr({field.xmlstring},'<id>') = 7)then
       mid(totext({field.xmlstring}),instr({field.xmlstring},'<id>')+4,3)
    else if(instr({field.xmlstring},'</id>')  - instr({field.xmlstring},'<id>') = 8)then
       mid(totext({field.xmlstring}),instr({field.xmlstring},'<id>')+4,4)
    else if(instr({field.xmlstring},'</id>')  - instr({field.xmlstring},'<id>') = 9)then
       mid(totext({field.xmlstring}),instr({field.xmlstring},'<id>')+4,5)
    I use the conditions to cover all possible lengths of the id number.

  • Passing xml as string to xmlPanel function

    hello Genius,
    I am using XML2UI feature of Extending Flash. I want to pass
    XML through string in place of xml file in xmlPanel function.
    is there any way to avoid creating 20 xml files and
    distributing them as my planned extension have 20 ui's.
    thanks in advance.

    Hai Shyam,
    I have tried to do as u have mentioned but still its not taking it as a paramater.
    i mean the API say
    parse
    public void parse(InputSource input) throws IOException,
    SAXExceptionParse an XML document.
    The application can use this method to instruct the XML reader to begin parsing an XML document from any valid input source (a character stream, a byte stream, or a URI).
    Is is any way to convert string to (char stream or byte stream).
    Thanks a lot
    Pooja.

  • Deserialization error: unexpected XML reader state. expected: END but found

    I have a JWSDP (on weblogic 8.1 SP2) web service that is supposed to return a string that contains a small XML file. The client can call and invoke the service just fine and the service runs. When the client reads the response it blows up with the error below, what is causing this? The response looks okay to me.
    ====================================
    ERROR FROM THE CLIENT
    ====================================
    [java] java.rmi.RemoteException: Runtime exception; nested exception is:
    [java] deserialization error: unexpected XML reader state. expected: END but found: START: exchangeDataResult
    [java] at com.sun.xml.rpc.client.StreamingSender._handleRuntimeExceptionInSend(Ljava.lang.RuntimeExceptionV(StreamingSender.java:248)
    [java] at com.sun.xml.rpc.client.StreamingSender._send(Ljava.lang.String;Lcom.sun.xml.rpc.client.StreamingSenderStateV(StreamingSender.java:230)
    [java] at com.mcdata.websvc.riverbed.server.DataExchangerSoap_Stub.exchangeData(Ljava.lang.String;Ljava.lang.String;Ljava.lang.String;Ljava.lang.StringLjava.lang.String;(DataExchangerSoap_Stub.java:70)
    [java] at jsp_compiled.__index._jspService(Ljavax.servlet.http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponseV(__index.java:141)
    [java] at weblogic.servlet.jsp.JspBase.service(Ljavax.servlet.ServletRequest;Ljavax.servlet.ServletResponseV(JspBase.java:33)
    [java] at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run()Ljava.lang.Object;(ServletStubImpl.java:971)
    [java] at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax.servlet.ServletRequest;Ljavax.servlet.ServletResponse;Lweblogic.servlet.internal.FilterChainImplV(ServletStubImpl.java:402)
    [java] at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax.servlet.ServletRequest;Ljavax.servlet.ServletResponseV(ServletStubImpl.java:305)
    [java] at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run()Ljava.lang.Object;(WebAppServletContext.java:6350)
    [java] at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Lweblogic.security.subject.AbstractSubject;Ljava.security.PrivilegedActionLjava.lang.Object;(AuthenticatedSubject.java:317)
    [java] at weblogic.security.service.SecurityManager.runAs(Lweblogic.security.acl.internal.AuthenticatedSubject;Lweblogic.security.acl.internal.AuthenticatedSubject;Ljava.security.PrivilegedActionLjava.lang.Object;(SecurityManager.java:118)
    [java] at weblogic.servlet.internal.WebAppServletContext.invokeServlet(Lweblogic.servlet.internal.ServletRequestImpl;Lweblogic.servlet.internal.ServletResponseImplV(WebAppServletContext.java:3635)
    [java] at weblogic.servlet.internal.ServletRequestImpl.execute(Lweblogic.kernel.ExecuteThreadV(ServletRequestImpl.java:2585)
    [java] at weblogic.kernel.ExecuteThread.execute(Lweblogic.kernel.ExecuteRequestV(ExecuteThread.java:197)
    [java] at weblogic.kernel.ExecuteThread.run()V(ExecuteThread.java:170)
    [java] at java.lang.Thread.startThreadFromVM(Ljava.lang.ThreadV(Unknown Source)
    [java] Caused by: deserialization error: unexpected XML reader state. expected: END but found: START: exchangeDataResult
    [java] at com.sun.xml.rpc.encoding.literal.LiteralSimpleTypeSerializer.deserialize(Ljavax.xml.namespace.QName;Lcom.sun.xml.rpc.streaming.XMLReader;Lcom.sun.xml.rpc.encoding.SOAPDeserializationContextLjava.lang.Object;(LiteralSimpleTypeSeri
    alizer.java:133)
    [java] at com.mcdata.websvc.riverbed.server.DataExchangerSoap_Stub._deserialize_exchangeData(Lcom.sun.xml.rpc.streaming.XMLReader;Lcom.sun.xml.rpc.encoding.SOAPDeserializationContext;Lcom.sun.xml.rpc.client.StreamingSenderStateV(DataExchan
    gerSoap_Stub.java:117)
    [java] at com.mcdata.websvc.riverbed.server.DataExchangerSoap_Stub._readFirstBodyElement(Lcom.sun.xml.rpc.streaming.XMLReader;Lcom.sun.xml.rpc.encoding.SOAPDeserializationContext;Lcom.sun.xml.rpc.client.StreamingSenderStateV(DataExchangerS
    oap_Stub.java:104)
    [java] at com.sun.xml.rpc.client.StreamingSender._send(Ljava.lang.String;Lcom.sun.xml.rpc.client.StreamingSenderStateV(StreamingSender.java:158)
    [java] ... 14 more
    ====================================
    SOAP RESPONSE
    ====================================
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <env:Header>
    </env:Header>
    <env:Body env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <m:exchangeDataResponse xmlns:m="https://partners.mcdata.com">
    <exchangeDataResult xsi:type="xsd:string"><status>OK</status>
    <message>Transaction accepted.</message></exchangeDataResult>
    </m:exchangeDataResponse>
    </env:Body>
    </env:Envelope>
    ====================================
    WSDL
    ====================================
    <?xml version="1.0" encoding="utf-8"?>
    <wsdl:definitions
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
    xmlns:tns="https://partners.mcdata.com"
    xmlns:s="http://www.w3.org/2001/XMLSchema"
    xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
    xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
    targetNamespace="https://partners.mcdata.com"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    name="">
    <wsdl:types>
    <s:schema elementFormDefault="qualified" targetNamespace="https://partners.mcdata.com">
    <s:element name="exchangeData">
    <s:complexType>
    <s:sequence>
    <s:element minOccurs="0" maxOccurs="1" name="sender" type="s:string" />
    <s:element minOccurs="0" maxOccurs="1" name="password" type="s:string" />
    <s:element minOccurs="0" maxOccurs="1" name="transactionType" type="s:string" />
    <s:element minOccurs="0" maxOccurs="1" name="data" type="s:string" />
    </s:sequence>
    </s:complexType>
    </s:element>
    <s:element name="exchangeDataResponse" type="s:string" />
    </s:schema>
    </wsdl:types>
    <wsdl:message name="exchangeDataSoapIn">
    <wsdl:part name="parameters" element="tns:exchangeData" />
    </wsdl:message>
    <wsdl:message name="exchangeDataSoapOut">
    <wsdl:part name="parameters" element="tns:exchangeDataResponse" />
    </wsdl:message>
    <wsdl:portType name="DataExchangerSoap">
    <wsdl:operation name="exchangeData">
    <wsdl:input message="tns:exchangeDataSoapIn" />
    <wsdl:output message="tns:exchangeDataSoapOut" />
    </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="DataExchangerSoap" type="tns:DataExchangerSoap">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
    <wsdl:operation name="exchangeData">
    <soap:operation soapAction="https://208.47.133.243/riverbedshipserver/exchangeData" style="document" />
    <wsdl:input>
    <soap:body use="literal" />
    </wsdl:input>
    <wsdl:output>
    <soap:body use="literal" />
    </wsdl:output>
    </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="DataExchanger">
    <wsdl:port name="DataExchangerSoap" binding="tns:DataExchangerSoap">
    <soap:address location="https://208.47.133.243/riverbedshipserver/exchangeData" />
    </wsdl:port>
    </wsdl:service>
    </wsdl:definitions>
    ====================================
    web-services.xml
    ====================================
    <web-services>
    <web-service
    name="riverbedshipserver"
    targetNamespace="https://partners.mcdata.com"
    uri="exchangeData"
    >
    <components>
    <java-class name="DataExchanger" class-name="com.mcdata.websvc.riverbed.server.DataExchangerImpl"/>
    </components>
    <operations xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <operation name="exchangeData" component="DataExchanger" method="exchangeData">
    <params>
    <param name="sender" style="in" type="xsd:string" location="header"/>
    <param name="password" style="in" type="xsd:string" location="header"/>
    <param name="transactionType" style="in" type="xsd:string" location="header"/>
    <param name="data" style="in" type="xsd:string" location="header"/>
    <return-param name="exchangeDataResult" type="xsd:string"/>
    </params>
    </operation>
    </operations>
    </web-service>
    </web-services>

    This is caused by the response xml parameter is greater than the response parameter you have specified in your wsdl. Try to use packet monitoring to monitor all the process, you will notice that problems.

  • Deserialization error: unexpected XML reader state. expected: END but foun

    Can anyone help why there is an ERROR when invoking web service (Using 1.4.2 and jwsdp 1.6 )
    The ERROR
    java.rmi.RemoteException: Runtime exception; nested exception is:
    deserialization error: unexpected XML reader state. expected: END but found: START: accoId
    at com.sun.xml.rpc.client.StreamingSender._handleRuntimeExceptionInSend(StreamingSender.java:331)
    at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:313)
    at webservices.dispatcherExim.DispatcherEximPort_Stub.getArrayVO(DispatcherEximPort_Stub.java:69)
    at client.StatsClient2.main(Unknown Source)
    Caused by: deserialization error: unexpected XML reader state. expected: END but found: START: accoId
    at com.sun.xml.rpc.encoding.ObjectSerializerBase.deserialize(ObjectSerializerBase.java:233)
    at com.sun.xml.rpc.encoding.ReferenceableSerializerImpl.deserialize(ReferenceableSerializerImpl.java:155)
    at webservices.dispatcherExim.DispatcherEximPort_getArrayVO_ResponseStruct_SOAPSerializer.doDeserialize(DispatcherExi
    mPort_getArrayVO_ResponseStruct_SOAPSerializer.java:43)
    at com.sun.xml.rpc.encoding.ObjectSerializerBase.deserialize(ObjectSerializerBase.java:192)
    at com.sun.xml.rpc.encoding.ReferenceableSerializerImpl.deserialize(ReferenceableSerializerImpl.java:155)
    at webservices.dispatcherExim.DispatcherEximPort_Stub._deserialize_getArrayVO(DispatcherEximPort_Stub.java:117)
    at webservices.dispatcherExim.DispatcherEximPort_Stub._readFirstBodyElement(DispatcherEximPort_Stub.java:104)
    at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:228)
    ... 2 more
    Command to create stubs
    wscompile.bat -verbose -gen:both -f:searchschema -f:rpcliteral -f:wsi -keep -s src -d build src/config.xml
    This is config.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <configuration
    xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/config">
    <wsdl
    location="./src/DispatcherExim.wsdl"
    packageName="webservices.dispatcherExim" />
    </configuration>
    Calling
    java -Djava.endorsed.dirs=%JWSDP_HOME%jaxp\lib%JWSDP_HOME%jaxp\lib\endorsed -classpath .;%JWSDP_HOME%saaj\lib\saaj-api.jar;%JWSDP_HOME%saaj\lib\saaj-impl.jar;%JWSDP_HOME%jaxrpc\lib\jaxrpc-spi.jar;%JWSDP_HOME%jaxrpc\lib\jaxrpc-api.jar;%JWSDP_HOME%jaxrpc\lib\jaxrpc-impl.jar;%JWSDP_HOME%jwsdp-shared\lib\mail.jar;%JWSDP_HOME%jwsdp-shared\lib\activation.jar;C:\jpro\xml\jwsdl\dist\client.jar;C:\jpro\xml\jwsdl\dist\wsstub-xt.jar;C:\jwsdp1.5\jwsdp-shared\lib\commons-logging.jar client.StatsClient2
    This is a Response
    <?xml version="1.0" encoding="utf-8" standalone="yes"?>
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <env:Header/>
    <env:Body env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <m:getArrayVOResponse xmlns:m="http://www.eximb.com/nimius/Dispatch">
    <result xmlns:n1="java:com.eximb.nimius.base.common.data" xsi:type="n1:ArrayVO">
    <accoId xsi:type="xsd:decimal">1</accoId>
    <name xsi:type="xsd:string">TEST </name>
    <prodValueDate xsi:type="xsd:dateTime">2005-06-24T14:59:01.093+03:00</prodValueDate>
    </result>
    </m:getArrayVOResponse>
    </env:Body>
    </env:Envelope>
    Here is WSDL
    <?xml version="1.0" encoding="utf-8" ?>
    - <definitions xmlns:tns="http://www.eximb.com/nimius/Dispatch" xmlns:wsr="http://www.openuri.org/2002/10/soap/reliability/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap12enc="http://www.w3.org/2002/12/soap-encoding" xmlns:conv="http://www.openuri.org/2002/04/wsdl/conversation/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://www.eximb.com/nimius/Dispatch">
    - <types xmlns:tns="http://www.eximb.com/nimius/Dispatch" xmlns:wsr="http://www.openuri.org/2002/10/soap/reliability/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap12enc="http://www.w3.org/2002/12/soap-encoding" xmlns:conv="http://www.openuri.org/2002/04/wsdl/conversation/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/">
    - <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:stns="java:com.eximb.nimius.base.common.data" elementFormDefault="qualified" attributeFormDefault="qualified" targetNamespace="java:com.eximb.nimius.base.common.data">
    - <xsd:complexType name="ArrayVO">
    - <xsd:sequence>
    <xsd:element type="xsd:decimal" name="accoId" minOccurs="1" nillable="true" maxOccurs="1" />
    <xsd:element type="xsd:string" name="name" minOccurs="1" nillable="true" maxOccurs="1" />
    <xsd:element type="xsd:dateTime" name="prodValueDate" minOccurs="1" nillable="true" maxOccurs="1" />
    </xsd:sequence>
    </xsd:complexType>
    </xsd:schema>
    </types>
    <message name="getArrayVO" />
    - <message name="getArrayVOResponse">
    <part xmlns:partns="java:com.eximb.nimius.base.common.data" type="partns:ArrayVO" name="result" />
    </message>
    - <portType name="DispatcherEximPort">
    - <operation name="getArrayVO">
    <input message="tns:getArrayVO" />
    <output message="tns:getArrayVOResponse" />
    </operation>
    </portType>
    - <binding type="tns:DispatcherEximPort" name="DispatcherEximPort">
    <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
    - <operation name="getArrayVO">
    <soap:operation style="rpc" soapAction="" />
    - <input>
    <soap:body namespace="http://www.eximb.com/nimius/Dispatch" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" />
    </input>
    - <output>
    <soap:body namespace="http://www.eximb.com/nimius/Dispatch" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" />
    </output>
    </operation>
    </binding>
    - <service name="DispatcherExim">
    - <port name="DispatcherEximPort" binding="tns:DispatcherEximPort">
    <soap:address location="http://localhost:7001//DispatcherExim" />
    </port>
    </service>
    </definitions>
    Thank you.

    I have had this problem and I found that I was sending elements in a different order than the order specified in the WSDL. The elements don't all have to be present, but any that are present need to be in the same sequence.

  • Unexpected XML reader state. expected: END_ELEMENT but found: CHARACTERS

    I'm try to developed a ws client. the server is in Microsoft-IIS/6.0.
    the method that i'm try to invoke return void, this is the interface
    * Sends a diagnostic request to a device
    * @param deviceId
    * @param url
    @WebMethod(operationName = "SendDiagnosticRequestToDevice", action = "http://client.org/SendDiagnosticRequestToDevice")
    @RequestWrapper(localName = "SendDiagnosticRequestToDevice", targetNamespace = "http://teste.org/", className = "client.SendDiagnosticRequestToDevice")
    @ResponseWrapper(localName = "SendDiagnosticRequestToDeviceResponse", targetNamespace = "http://teste.org/", className = "client.SendDiagnosticRequestToDeviceResponse")
    public void sendDiagnosticRequestToDevice(
    @WebParam(name = "deviceId", targetNamespace = "http://tempuri.org/")
    String deviceId,
    @WebParam(name = "url", targetNamespace = "http://teste.org/")
    String url);
    my client only have this code
    DiagnosticsNotificationsWS service = new DiagnosticsNotificationsWS()
    DiagnosticsNotificationsWSSoap port = service.getDiagnosticsNotificationsWSSoap();
    port.sendDiagnosticRequestToDevice("8670eaab", "http://10.112.80.12/teste?wsdl");
    but have follow error:
    Exception in thread "main" javax.xml.ws.WebServiceException: unexpected XML reader state. expected: END_ELEMENT but found: CHARACTERS
    at com.sun.xml.ws.encoding.soap.client.SOAPXMLDecoder.toInternalMessage(SOAPXMLDecoder.java:263)
    at com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.receive(SOAPMessageDispatcher.java:545)
    at com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.doSend(SOAPMessageDispatcher.java:288)
    at com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.send(SOAPMessageDispatcher.java:153)
    at com.sun.xml.ws.encoding.soap.internal.DelegateBase.send(DelegateBase.java:85)
    at com.sun.xml.ws.client.EndpointIFInvocationHandler.implementSEIMethod(EndpointIFInvocationHandler.java:176)
    at com.sun.xml.ws.client.EndpointIFInvocationHandler.invoke(EndpointIFInvocationHandler.java:105)
    at $Proxy24.sendDiagnosticRequestToDevice(Unknown Source)
    at Main.main(Main.java:45)
    Caused by: unexpected XML reader state. expected: END_ELEMENT but found: CHARACTERS
    at com.sun.xml.ws.streaming.XMLStreamReaderUtil.verifyReaderState(XMLStreamReaderUtil.java:193)
    at com.sun.xml.ws.encoding.soap.client.SOAPXMLDecoder.decodeFault(SOAPXMLDecoder.java:349)
    at com.sun.xml.ws.encoding.soap.SOAPDecoder.decodeBodyContent(SOAPDecoder.java:340)
    at com.sun.xml.ws.encoding.soap.SOAPDecoder.decodeBody(SOAPDecoder.java:325)
    at com.sun.xml.ws.encoding.soap.client.SOAPXMLDecoder.decodeBody(SOAPXMLDecoder.java:188)
    at com.sun.xml.ws.encoding.soap.client.SOAPXMLDecoder.decodeEnvelope(SOAPXMLDecoder.java:139)
    at com.sun.xml.ws.encoding.soap.client.SOAPXMLDecoder.toInternalMessage(SOAPXMLDecoder.java:256)
    ... 8 more

    may be bug of IIS. You received at the end of content "HTTP 100 Continue"
    see MSDN
    Edited by: Nesterko on Jun 17, 2010 11:38 AM

  • Unexpected XML reader state. expected: END but found: START:

    Hi,
    I am wrote a web client using JWSDP-2.0 and JWSDP-1.4.
    When I run my client I get following error.
    java.rmi.RemoteException: Runtime exception; nested exception is:
    deserialization error: unexpected XML reader state. expected: END but found: START: m_dValue; nested e
    xception is:
    java.rmi.RemoteException: Runtime exception; nested exception is:
    deserialization error: unexpected XML reader state. expected: END but found: START: m_dValue
    at com.engagenet.protoObj.wizcon.TagServiceSoap_Stub.readTagValues(TagServiceSoap_Stub.java:92)
    at com.engagenet.protoObj.wizcon.TagService_Impl.main(TagService_Impl.java:78)
    Caused by: java.rmi.RemoteException: Runtime exception; nested exception is:
    deserialization error: unexpected XML reader state. expected: END but found: START: m_dValue
    at com.sun.xml.rpc.client.StreamingSender._handleRuntimeExceptionInSend(StreamingSender.java:331)
    at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:313)
    at com.engagenet.protoObj.wizcon.TagServiceSoap_Stub.readTagValues(TagServiceSoap_Stub.java:70)
    ... 1 more
    Caused by: deserialization error: unexpected XML reader state. expected: END but found: START: m_dValue
    at com.sun.xml.rpc.encoding.ObjectSerializerBase.deserialize(ObjectSerializerBase.java:233)
    at com.sun.xml.rpc.encoding.ReferenceableSerializerImpl.deserialize(ReferenceableSerializerImpl.java:1
    55)
    at com.sun.xml.rpc.encoding.ObjectArraySerializer.deserializeArrayInstance(ObjectArraySerializer.java:
    207)
    at com.sun.xml.rpc.encoding.ArraySerializerBase.deserialize(ArraySerializerBase.java:260)
    at com.sun.xml.rpc.encoding.ReferenceableSerializerImpl.deserialize(ReferenceableSerializerImpl.java:1
    55)
    at com.engagenet.protoObj.wizcon.TagServiceSoap_ReadTagValues_ResponseStruct_SOAPSerializer.doDeserial
    ize(TagServiceSoap_ReadTagValues_ResponseStruct_SOAPSerializer.java:43)
    at com.sun.xml.rpc.encoding.ObjectSerializerBase.deserialize(ObjectSerializerBase.java:192)
    at com.sun.xml.rpc.encoding.ReferenceableSerializerImpl.deserialize(ReferenceableSerializerImpl.java:1
    55)
    at com.engagenet.protoObj.wizcon.TagServiceSoap_Stub._deserialize_ReadTagValues(TagServiceSoap_Stub.ja
    va:336)
    at com.engagenet.protoObj.wizcon.TagServiceSoap_Stub._readFirstBodyElement(TagServiceSoap_Stub.java:31
    1)
    at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:228)
    ... 2 more
    Here is my wsdl file
    <?xml version="1.0" encoding="utf-8"?>
    <wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="urn:WizWebService" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="urn:WizWebService" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
    <wsdl:types>
    <s:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="urn:WizWebService">
    <s:import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
    <s:complexType name="ReadTagValues_return_Array">
    <s:complexContent mixed="false">
    <s:restriction base="soapenc:Array">
    <s:attribute wsdl:arrayType="tns:TagValue[]" ref="soapenc:arrayType" />
    </s:restriction>
    </s:complexContent>
    </s:complexType>
    <s:complexType name="ReadTagValues_tagNames_Array">
    <s:complexContent mixed="false">
    <s:restriction base="soapenc:Array">
    <s:attribute wsdl:arrayType="s:string[]" ref="soapenc:arrayType" />
    </s:restriction>
    </s:complexContent>
    </s:complexType>
    <s:complexType name="ReadTagStringValues_return_Array">
    <s:complexContent mixed="false">
    <s:restriction base="soapenc:Array">
    <s:attribute wsdl:arrayType="tns:TagStringValue[]" ref="soapenc:arrayType" />
    </s:restriction>
    </s:complexContent>
    </s:complexType>
    <s:complexType name="ReadTagStringValues_tagNames_Array">
    <s:complexContent mixed="false">
    <s:restriction base="soapenc:Array">
    <s:attribute wsdl:arrayType="s:string[]" ref="soapenc:arrayType" />
    </s:restriction>
    </s:complexContent>
    </s:complexType>
    <s:complexType name="WriteTagValues_return_Array">
    <s:complexContent mixed="false">
    <s:restriction base="soapenc:Array">
    <s:attribute wsdl:arrayType="tns:QUALITY[]" ref="soapenc:arrayType" />
    </s:restriction>
    </s:complexContent>
    </s:complexType>
    <s:complexType name="WriteTagValues_tagNames_Array">
    <s:complexContent mixed="false">
    <s:restriction base="soapenc:Array">
    <s:attribute wsdl:arrayType="s:string[]" ref="soapenc:arrayType" />
    </s:restriction>
    </s:complexContent>
    </s:complexType>
    <s:complexType name="WriteTagValues_tagValues_Array">
    <s:complexContent mixed="false">
    <s:restriction base="soapenc:Array">
    <s:attribute wsdl:arrayType="s:double[]" ref="soapenc:arrayType" />
    </s:restriction>
    </s:complexContent>
    </s:complexType>
    <s:complexType name="WriteTagStringValues_return_Array">
    <s:complexContent mixed="false">
    <s:restriction base="soapenc:Array">
    <s:attribute wsdl:arrayType="tns:QUALITY[]" ref="soapenc:arrayType" />
    </s:restriction>
    </s:complexContent>
    </s:complexType>
    <s:complexType name="WriteTagStringValues_tagNames_Array">
    <s:complexContent mixed="false">
    <s:restriction base="soapenc:Array">
    <s:attribute wsdl:arrayType="s:string[]" ref="soapenc:arrayType" />
    </s:restriction>
    </s:complexContent>
    </s:complexType>
    <s:complexType name="WriteTagStringValues_tagValues_Array">
    <s:complexContent mixed="false">
    <s:restriction base="soapenc:Array">
    <s:attribute wsdl:arrayType="s:string[]" ref="soapenc:arrayType" />
    </s:restriction>
    </s:complexContent>
    </s:complexType>
    <s:complexType name="GetTagNames_return_Array">
    <s:complexContent mixed="false">
    <s:restriction base="soapenc:Array">
    <s:attribute wsdl:arrayType="tns:TagName[]" ref="soapenc:arrayType" />
    </s:restriction>
    </s:complexContent>
    </s:complexType>
    <s:simpleType name="TAG_FORMAT">
    <s:restriction base="s:string">
    <s:enumeration value="F_STRING" />
    <s:enumeration value="F_NUMERIC" />
    </s:restriction>
    </s:simpleType>
    <s:simpleType name="QUALITY">
    <s:restriction base="s:string">
    <s:enumeration value="Q_ERR" />
    <s:enumeration value="Q_OK" />
    </s:restriction>
    </s:simpleType>
    <s:complexType name="TagStringValue">
    <s:sequence>
    <s:element name="m_bstrValue" type="s:string" />
    <s:element name="m_Quality" type="tns:QUALITY" />
    </s:sequence>
    </s:complexType>
    <s:complexType name="TagName">
    <s:sequence>
    <s:element name="m_bstrName" type="s:string" />
    <s:element name="m_Format" type="tns:TAG_FORMAT" />
    </s:sequence>
    </s:complexType>
    <s:complexType name="TagValue">
    <s:sequence>
    <s:element name="m_dValue" type="s:double" />
    <s:element name="m_Quality" type="tns:QUALITY" />
    </s:sequence>
    </s:complexType>
    </s:schema>
    </wsdl:types>
    <wsdl:message name="ReadTagValuesIn">
    <wsdl:part name="tagNames" type="tns:ReadTagValues_tagNames_Array" />
    </wsdl:message>
    <wsdl:message name="ReadTagValuesOut">
    <wsdl:part name="return" type="tns:ReadTagValues_return_Array" />
    </wsdl:message>
    <wsdl:message name="ReadTagStringValuesIn">
    <wsdl:part name="tagNames" type="tns:ReadTagStringValues_tagNames_Array" />
    </wsdl:message>
    <wsdl:message name="ReadTagStringValuesOut">
    <wsdl:part name="return" type="tns:ReadTagStringValues_return_Array" />
    </wsdl:message>
    <wsdl:message name="WriteTagValuesIn">
    <wsdl:part name="tagNames" type="tns:WriteTagValues_tagNames_Array" />
    <wsdl:part name="tagValues" type="tns:WriteTagValues_tagValues_Array" />
    </wsdl:message>
    <wsdl:message name="WriteTagValuesOut">
    <wsdl:part name="return" type="tns:WriteTagValues_return_Array" />
    </wsdl:message>
    <wsdl:message name="WriteTagStringValuesIn">
    <wsdl:part name="tagNames" type="tns:WriteTagStringValues_tagNames_Array" />
    <wsdl:part name="tagValues" type="tns:WriteTagStringValues_tagValues_Array" />
    </wsdl:message>
    <wsdl:message name="WriteTagStringValuesOut">
    <wsdl:part name="return" type="tns:WriteTagStringValues_return_Array" />
    </wsdl:message>
    <wsdl:message name="GetTagNamesIn">
    <wsdl:part name="bstrStnName" type="s:string" />
    </wsdl:message>
    <wsdl:message name="GetTagNamesOut">
    <wsdl:part name="return" type="tns:GetTagNames_return_Array" />
    </wsdl:message>
    <wsdl:portType name="TagServiceSoap">
    <wsdl:operation name="ReadTagValues">
    <wsdl:input message="tns:ReadTagValuesIn" />
    <wsdl:output message="tns:ReadTagValuesOut" />
    </wsdl:operation>
    <wsdl:operation name="ReadTagStringValues">
    <wsdl:input message="tns:ReadTagStringValuesIn" />
    <wsdl:output message="tns:ReadTagStringValuesOut" />
    </wsdl:operation>
    <wsdl:operation name="WriteTagValues">
    <wsdl:input message="tns:WriteTagValuesIn" />
    <wsdl:output message="tns:WriteTagValuesOut" />
    </wsdl:operation>
    <wsdl:operation name="WriteTagStringValues">
    <wsdl:input message="tns:WriteTagStringValuesIn" />
    <wsdl:output message="tns:WriteTagStringValuesOut" />
    </wsdl:operation>
    <wsdl:operation name="GetTagNames">
    <wsdl:input message="tns:GetTagNamesIn" />
    <wsdl:output message="tns:GetTagNamesOut" />
    </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="TagServiceSoap" type="tns:TagServiceSoap">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc" />
    <wsdl:operation name="ReadTagValues">
    <soap:operation soapAction="#ReadTagValues" style="rpc" />
    <wsdl:input>
    <soap:body use="encoded" namespace="urn:WizWebService" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
    </wsdl:input>
    <wsdl:output>
    <soap:body use="encoded" namespace="urn:WizWebService" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
    </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="ReadTagStringValues">
    <soap:operation soapAction="#ReadTagStringValues" style="rpc" />
    <wsdl:input>
    <soap:body use="encoded" namespace="urn:WizWebService" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
    </wsdl:input>
    <wsdl:output>
    <soap:body use="encoded" namespace="urn:WizWebService" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
    </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="WriteTagValues">
    <soap:operation soapAction="#WriteTagValues" style="rpc" />
    <wsdl:input>
    <soap:body use="encoded" namespace="urn:WizWebService" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
    </wsdl:input>
    <wsdl:output>
    <soap:body use="encoded" namespace="urn:WizWebService" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
    </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="WriteTagStringValues">
    <soap:operation soapAction="#WriteTagStringValues" style="rpc" />
    <wsdl:input>
    <soap:body use="encoded" namespace="urn:WizWebService" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
    </wsdl:input>
    <wsdl:output>
    <soap:body use="encoded" namespace="urn:WizWebService" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
    </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="GetTagNames">
    <soap:operation soapAction="#GetTagNames" style="rpc" />
    <wsdl:input>
    <soap:body use="encoded" namespace="urn:WizWebService" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
    </wsdl:input>
    <wsdl:output>
    <soap:body use="encoded" namespace="urn:WizWebService" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
    </wsdl:output>
    </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="TagService">
    <wsdl:port name="TagServiceSoap" binding="tns:TagServiceSoap">
    <soap:address location="http://212.157.43.123:80/wiz_ws/wizws.dll?Handler=TagService" />
    </wsdl:port>
    </wsdl:service>
    </wsdl:definitions>
    Here is my web client
    // This class was generated by the JAXRPC SI, do not edit.
    // Contents subject to change without notice.
    // JAX-RPC Standard Implementation (1.1.3, build R1)
    // Generated source version: 1.1.3
    package com.engagenet.protoObj.wizcon;
    import com.sun.xml.rpc.encoding.*;
    import com.sun.xml.rpc.client.ServiceExceptionImpl;
    import com.sun.xml.rpc.util.exception.*;
    import com.sun.xml.rpc.soap.SOAPVersion;
    import com.sun.xml.rpc.client.HandlerChainImpl;
    import javax.xml.rpc.*;
    import javax.xml.rpc.encoding.*;
    import javax.xml.rpc.handler.HandlerChain;
    import javax.xml.rpc.handler.HandlerInfo;
    import javax.xml.namespace.QName;
    public class TagService_Impl extends com.sun.xml.rpc.client.BasicService implements TagService {
    private static final QName serviceName = new QName("urn:WizWebService", "TagService");
    private static final QName ns1_TagServiceSoap_QNAME = new QName("urn:WizWebService", "TagServiceSoap");
    private static final Class tagServiceSoap_PortClass = com.engagenet.protoObj.wizcon.TagServiceSoap.class;
    public TagService_Impl() {
    super(serviceName, new QName[] {
    ns1_TagServiceSoap_QNAME
    new com.engagenet.protoObj.wizcon.TagService_SerializerRegistry().getRegistry());
    public java.rmi.Remote getPort(javax.xml.namespace.QName portName, java.lang.Class serviceDefInterface) throws javax.xml.rpc.ServiceException {
    try {
    if (portName.equals(ns1_TagServiceSoap_QNAME) &&
    serviceDefInterface.equals(tagServiceSoap_PortClass)) {
    return getTagServiceSoap();
    } catch (Exception e) {
    throw new ServiceExceptionImpl(new LocalizableExceptionAdapter(e));
    return super.getPort(portName, serviceDefInterface);
    public java.rmi.Remote getPort(java.lang.Class serviceDefInterface) throws javax.xml.rpc.ServiceException {
    try {
    if (serviceDefInterface.equals(tagServiceSoap_PortClass)) {
    return getTagServiceSoap();
    } catch (Exception e) {
    throw new ServiceExceptionImpl(new LocalizableExceptionAdapter(e));
    return super.getPort(serviceDefInterface);
    public com.engagenet.protoObj.wizcon.TagServiceSoap getTagServiceSoap() {
    java.lang.String[] roles = new java.lang.String[] {};
    HandlerChainImpl handlerChain = new HandlerChainImpl(getHandlerRegistry().getHandlerChain(ns1_TagServiceSoap_QNAME));
    handlerChain.setRoles(roles);
    com.engagenet.protoObj.wizcon.TagServiceSoap_Stub stub = new com.engagenet.protoObj.wizcon.TagServiceSoap_Stub(handlerChain);
    try {
    stub._initialize(super.internalTypeRegistry);
    } catch (JAXRPCException e) {
    throw e;
    } catch (Exception e) {
    throw new JAXRPCException(e.getMessage(), e);
    return stub;
         public static void main(String []args)
    try
    TagService_Impl proto = new TagService_Impl();
    TagServiceSoap tSoap = proto.getTagServiceSoap();
    QUALITY Q_ERR = QUALITY.fromString("Q_ERR");
    String tagName[] = {"aem_opc", "aem_ws_test", "wizsys_minute"};
    TagValue[] tValue = tSoap.readTagValues(tagName);
    for(int i = 0; i < 3; ++i)
    if(tValue.getM_Quality().equals(Q_ERR))
    System.out.println("" + tagName[i] + " read failed " + tValue[i].getM_Quality());
    else
    System.out.println("" + tagName[i] + " read failed " + tValue[i].getM_dValue());
    catch(Exception e)
    e.printStackTrace();
    Am I doing any thing wrong. All java files I am using is generated as a result of this command.
    wscompile.bat -verbose -gen -d classes -s src -keep etc/config.xml
    I only add main method in TagService_Impl.java class which I highlighted above.
    Any help is apprecited.
    Thanks
    Shreey

    I stumbled upon this exception when I tried to send a complex type as a return parameter. The sequence in which the server sent the components of the complex type was different from the one the client artifacts expected. And because the deserializer generated by xrpcc can't survive this, it throws the exception that's bothering you.
    It may or may not be the same case with you, this is merely what I had to find out.

  • XML Reader - why re-invent the wheel

    Does anyone want to post the code to a good XML Reader that they currently have in use?

    Here is some very simple code that reads all of the nodes in an XML doc. I apologize to the writer of this code, I can't remember where I got it and what his/her name is. If someone recognizes it, please pipe up. Oh yeah, and I can't remember what needed to be referenced so I included a bunch of stuff.
    anywho:
    import org.w3c.dom.*;
    import org.xml.sax.*;
    import javax.xml.parsers.*;
    import java.util.*;
    import java.io.*;
    public class LoadXMLdoc {
      private Document document;
      public LoadXMLdoc() {
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        try {
          DocumentBuilder builder = factory.newDocumentBuilder();
          document = builder.parse( new File(yourDocumentPathAsStringHere) );
          Element root = document.getDocumentElement();
          String rootElement = (root.getTagName());
          root.normalize();
          System.out.println(rootElement);
          NodeList children = root.getChildNodes();
          System.out.println("It has "+ children.getLength() + " child nodes\n");
          for (int i=0;i<children.getLength();i++) {
            System.out.println(children.item(i).getNodeName());
          System.out.println("I'm done");
            } catch (SAXParseException spe) {
               // Error generated by the parser
               System.out.println("\n** Parsing error"
                  + ", line " + spe.getLineNumber()
                  + ", uri " + spe.getSystemId());
               System.out.println("   " + spe.getMessage() );
               // Use the contained exception, if any
               Exception  x = spe;
               if (spe.getException() != null)
                   x = spe.getException();
               x.printStackTrace();
            } catch (SAXException sxe) {
               // Error generated during parsing)
               Exception  x = sxe;
               if (sxe.getException() != null)
                   x = sxe.getException();
               x.printStackTrace();
            } catch (ParserConfigurationException pce) {
                // Parser with specified options can't be built
                pce.printStackTrace();
            } catch (IOException ioe) {
               // I/O error
               ioe.printStackTrace();
    }Hope that helps you. It helped me.
    Good Luck.
    Ben

  • XML to string using xslt or java mapping

    Hi Experts,
    I want to put xml into string and i need to change lessthan symbol to "&lt"   and greaterthan symbol to "&gt" , can anyone please help me how to do this??? can you provide code for java mapping or XSLT mapping to achive this.
    SOURCE
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:source_mt xmlns:ns0="urn:ppp:prototype">
       <row>
          <name1>IT</name1>
          <name2>SOLUTIONS</name2>
       </row>
    </ns0:source_mt>
    TARGET
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:target_mt xmlns:ns0="urn:ppp:prototype">
       <row>
          <Body>"&lt"name1"&gt" IT"&lt"/name1"&gt" "&lt"name2"&gt" SOLUTIONS"&lt";/name2"&gt" </Body>
       </row>
    </ns0:target_mt>

    Hi ,
          here is the XSLT code to obtain the desired output
    <xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml"/>
    <xsl:template match="/">
    <ns0:target_mt xmlns:ns0="urn:ppp:prototype">
         <xsl:for-each select="//row">
              <row>
                   <Body>
                        <xsl:for-each select="name1">
                                  <xsl:value-of select="concat('*&quot;&lt;&quot;name1&quot;&gt;&quot;*',normalize-space(.),'*&quot;&lt;&quot;/name1&quot;&gt;&quot;*')"></xsl:value-of>
                        </xsl:for-each>     
                        <xsl:for-each select="name2">
                                  <xsl:value-of select="concat('*&quot;&lt;&quot;name2&quot;&gt;&quot;*',normalize-space(.),'*&quot;&lt;&quot;/name2&quot;&gt;&quot;*')"></xsl:value-of>
                        </xsl:for-each>
                   </Body>
              </row>
         </xsl:for-each>
    </ns0:target_mt>      
    </xsl:template>
    </xsl:stylesheet>
    output produced as viewed in browser is
    http://postimage.org/image/1lqbgw8kk/
    Now to obtain exactly the output you posted earlier here is the code
    <xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml"/>
    <xsl:template match="/">
    <ns0:target_mt xmlns:ns0="urn:ppp:prototype">
         <xsl:for-each select="//row">
              <row>
                   <Body>
                        <xsl:for-each select="name1">
                                  <xsl:value-of select="concat('*&quot;&amp;lt&quot;name1&quot;&amp;gt&quot;*',normalize-space(.),'*&quot;&amp;lt&quot;/name1&quot;&amp;gt&quot;*')"></xsl:value-of>
                        </xsl:for-each>     
                        <xsl:for-each select="name2">
                                  <xsl:value-of select="concat('*&quot;&amp;lt&quot;name2&quot;&amp;gt&quot;*',normalize-space(.),'*&quot;&amp;lt&quot;/name2&quot;&amp;gt&quot;*')"></xsl:value-of>
                        </xsl:for-each>
                   </Body>
              </row>
         </xsl:for-each>
    </ns0:target_mt>      
    </xsl:template>
    </xsl:stylesheet>
    output you can see from link below
    http://postimage.org/image/2c7bzo478
    Hope this helps.
    Hi,
        Could you please kindly let us know if the solution is working properly as per your requirement?
    regards
    Anupam
    Edited by: anupamsap on Jul 26, 2011 6:29 AM
    Edited by: anupamsap on Jul 26, 2011 4:10 PM

Maybe you are looking for

  • Text to number and decimalSeparator

    Hi, I need to convert a text (in a textImput) to Number. Some times the user type: 1000.10 or 1000,10 do represent the same number (one thousand and 10 cents) the problema is that 1000,10 gives me NaN using the simple way: Number(mytxt.text) How can

  • Converting info message into error message hardcoded in a standard program.

    Hi all, Due to some Good Manufacturing Practices in the Pharmaceutical Industry, users are demanding that message i102(40) (SAPLCOSD / LCOSDF2D / FORM OrderTables_Fill line 478) a hardcoded info message be converted into an error message. I have stru

  • How to use table maintance generator

    Hi Friends, I wanted to add more data in predefined table. For that  table maintance is allowed with restriction. So anybody will tell me how to proceed for adding more data in table. Regards, Salil

  • Change import and play settings

    I do not want to import every audio CD I place in my PC..  In iTunes, I Changed Preferences, to PLAY, not import; then to SHOW, not import. It still imports no matter what. I then went to the CD,  changed my "OPEN WITH" to WMP, instead of itunes, as

  • Control iPhone from PC?

    Is there any tool that lets you control your iPhone from a PC? I have a friend who recently purchased an iPhone but lives far away and needs help setting up a few things. I was thinking if there was something you could use to show the screen and cont