Unexpected element type: QName vs. string

Hello,
i tried to run the "web service" example code of the book "Core Java" (2004). The program is a window where you can search for book authors in Amazon. But executing the client program results in:
Exception: java.rmi.RemoteException: Runtime exception; nested exception is:
     unexpected element type: expected={http://www.w3.org/2001/XMLSchema}QName, actual={http://www.w3.org/2001/XMLSchema}stringYou can find the code below.
Greetings
Alfred
config.xml
<?xml version="1.0" encoding="UTF-8"?>
<configuration
   xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/config">
   <wsdl location="http://soap.amazon.com/schemas3/AmazonWebServices.wsdl"
      packageName="com.amazon"/>
</configuration>snippet of SOAPTest.java (client program)
AmazonSearchPort port = (AmazonSearchPort)
            (new AmazonSearchService_Impl().getAmazonSearchPort());
         AuthorRequest request
            = new AuthorRequest(name, "1", "books", "", "lite", "", token, "","", "");
         ProductInfo response = port.authorSearchRequest(request);
         Details[] details = response.getDetails();
         StringBuilder r = new StringBuilder();
         for (Details d : details)
            r.append("authors=");
            String[] authors = d.getAuthors();
            if (authors == null) r.append("[]");
            else r.append(Arrays.asList(d.getAuthors()));
            r.append(",title=");
            r.append(d.getProductName());
            r.append(",publisher=");
            r.append(d.getManufacturer());
            r.append(",pubdate=");
            r.append(d.getReleaseDate());
            r.append("\n");
         return r.toString();

Amazon discontinued the old service. You can no longer get a working developer token for it. When you give it an invalid token, then an error message is produced.
Due to an error in the way Amazon produces the error message (see http://archives.java.sun.com/cgi-bin/wa?A2=ind0303&L=jaxrpc-interest&O=D&P=1513), you don't actually get to see it.

Similar Messages

  • Unexpected element name - confusion of types in client

    I have a web service definition that performs four operations:
    - String getTitle(long) - returns a title for a single asset
    - StringArrayType) getTitles(LongArrayType) - returns an ordered list of titles matching input list
    - AssetSummaryType getSummary(long) - Returns a complex type, summary information of an asset
    - AssetSummaryArrayType getSummaries(LongArrayType) - Returns an array of complex types
    Based on the WSDL (included at the bottom of this posting) I then generate the service
    endpoint using wscompile and -f:wsi option (JDK 1.4.2-05 and JWSDP-1.4).
    This is built into a raw war file and then cooked using wsdeploy.
    On the client side I create stubs using wscompile and -f:wsi and compile
    the resultant code. My client invokes each of the operations in turn, having been
    provided the relevant 'longs' as input.
    The service is deployed in JBoss-3.2.2 and the client is then executed from a separate JVM.
    I then see the following client error:
    java.rmi.RemoteException: Runtime exception; nested exception is:
    unexpected element name: expected={http://example.com/myAssetWebSvc}Str
    ingElement, actual={http://example.com/MyAssetWebSvc}AssetSummaryElement
    at com.sun.xml.rpc.client.StreamingSender._handleRuntimeExceptionInSend(
    StreamingSender.java:318)
    at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:300
    at example.com.wsclient.asset.AssetService_Stub.getTitle(AssetService_St
    ub.java:175)
    at example.com.wsclient.asset.AssetClient.testAssetTitleRetrieval(AssetC
    lient.java:82)
    at example.com.wsclient.asset.AssetClient.main(AssetClient.java:51)
    Caused by: unexpected element name: expected={http://example.com/MyAssetWebSvc}
    StringElement, actual={http://example.com/MyAssetWebSvc}AssetSummaryElement
    at com.sun.xml.rpc.encoding.literal.LiteralSimpleTypeSerializer.deserial
    ize(LiteralSimpleTypeSerializer.java:106)
    at example.com.wsclient.asset.AssetService_Stub._deserialize_getTitle(As
    setService_Stub.java:318)
    at example.com.wsclient.asset.AssetService_Stub._readFirstBodyElement(As
    setService_Stub.java:276)
    at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:215
    ... 3 more
    If I deploy the same service with only the first two operations defined within wsdl,
    the error is not seen.
    I have also tried compilation on JWSDP 1.3 and JDK 1.4.1-03 and in this case the same error
    occurs but the other way around. The two 'title' operations work but the summary
    operations fail with the actual element encountered being a StringElement or StringArrayElement
    and the expected an AssetSummaryElement or AssetSummaryArrayElement.
    Further, if I change the name of the StringElement to for example 'MyStringElement', this is
    reported as the actual - i.e. there is no confusion with a standard type at play here.
    I also use handlers, one on the server side to inspect security information and one on the
    client to insert relevant details and look for returned errors within the header.
    Is this a known problem within JWSDP 1.3 and/or 1.4? Are there any workarounds.
    My wsdl is provided below along with the wscompile options and the matching configuration
    files used.
    <?xml version="1.0" encoding="UTF-8"?>
    <wsdl:definitions name="MyAssetService" targetNamespace="http://example.com/MyAssetWebSvc"
         xmlns:tns="http://example.com/MyAssetWebSvc"
         xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
         xmlns:xsd="http://www.w3.org/2001/XMLSchema"
         xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
    <wsdl:types>
    <xsd:schema targetNamespace="http://example.com/MyAssetWebSvc"
              xmlns:tns="http://example.com/MyAssetWebSvc"
              xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <xsd:complexType name="AssetSummaryType">
    <xsd:all>
    <xsd:element name="createdBy" type="xsd:string" />
    <xsd:element name="createdDate" type="xsd:dateTime" />
    <xsd:element name="description" type="xsd:string" />
    <xsd:element name="fileSize" type="xsd:long" />
    <xsd:element name="id" type="xsd:long" />
    <xsd:element name="modifiedBy" type="xsd:string" />
    <xsd:element name="modifiedDate" type="xsd:dateTime" />
    <xsd:element name="organisation" type="xsd:string" />
    <xsd:element name="owner" type="xsd:string" />
    <xsd:element name="title" type="xsd:string" />
    <xsd:element name="type" type="xsd:string" />
    <xsd:element name="version" type="xsd:long" />
    </xsd:all>
    </xsd:complexType>
    <xsd:complexType name="ExceptionType">
    <xsd:all>
    <xsd:element name="rootCause" type="xsd:string" nillable="true" />
    </xsd:all>
    </xsd:complexType>
    <xsd:complexType name="LongArrayType">
         <xsd:sequence>
              <xsd:element name="LongItem" type="xsd:long" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
         </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="AssetSummaryArrayType">
         <xsd:sequence>
              <xsd:element name="AssetSummaryItem" type="tns:AssetSummaryType" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
         </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="StringArrayType">
         <xsd:sequence>
              <xsd:element name="StringItem" type="xsd:string" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
         </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="CredentialsType">
    <xsd:all>
    <xsd:element name="principal" type="xsd:string" />
    <xsd:element name="password" type="xsd:string" />
    </xsd:all>
    </xsd:complexType>
         <xsd:element name="LongElement" type="xsd:long"/>
    <xsd:element name="StringElement" type="xsd:string"/>
    <xsd:element name="LongArrayElement" type="tns:LongArrayType"/>
    <xsd:element name="StringArrayElement" type="tns:StringArrayType"/>
    <xsd:element name="AssetSummaryElement" type="tns:AssetSummaryType"/>
    <xsd:element name="AssetSummaryArrayElement" type="tns:AssetSummaryArrayType"/>
         <xsd:element name="CredentialsElement" type="tns:CredentialsType"/>
         <xsd:element name="ExceptionElement" type="tns:ExceptionType"/>
    </xsd:schema>
    </wsdl:types>
    <wsdl:message name="getSummaryMessage">
    <wsdl:part name="resourceId" element="tns:LongElement" />
    </wsdl:message>
    <wsdl:message name="getSummaryResponse">
    <wsdl:part name="assetSummary" element="tns:AssetSummaryElement" />
    </wsdl:message>
    <wsdl:message name="assetException">
    <wsdl:part name="exception" element="tns:ExceptionElement" />
    </wsdl:message>
    <wsdl:message name="getTitle">
    <wsdl:part name="resourceId" element="tns:LongElement" />
    </wsdl:message>
    <wsdl:message name="getTitleResponse">
    <wsdl:part name="assetTitle" element="tns:StringElement" />
    </wsdl:message>
    <wsdl:message name="getSummaries">
    <wsdl:part name="resourceIdList" element="tns:LongArrayElement" />
    </wsdl:message>
    <wsdl:message name="getSummariesResponse">
    <wsdl:part name="assetSummaryList" element="tns:AssetSummaryArrayElement" />
    </wsdl:message>
    <wsdl:message name="getTitles">
    <wsdl:part name="resourceIdList" element="tns:LongArrayElement" />
    </wsdl:message>
    <wsdl:message name="getTitlesResponse">
    <wsdl:part name="assetTitleList" element="tns:StringArrayElement" />
    </wsdl:message>
    <wsdl:message name="securityHeader">
    <wsdl:part name="credentials" element="tns:CredentialsElement" />
    </wsdl:message>
    <wsdl:portType name="AssetService">
    <wsdl:operation name="getSummary" parameterOrder="resourceId">
    <wsdl:input message="tns:getSummaryMessage" />
    <wsdl:output message="tns:getSummaryResponse" />
    <wsdl:fault name="AssetException" message="tns:assetException" />
    </wsdl:operation>
    <wsdl:operation name="getTitle" parameterOrder="resourceId">
    <wsdl:input message="tns:getTitle" />
    <wsdl:output message="tns:getTitleResponse" />
    <wsdl:fault name="AssetException" message="tns:assetException" />
    </wsdl:operation>
    <wsdl:operation name="getSummaries" parameterOrder="resourceIdList">
    <wsdl:input message="tns:getSummaries" />
    <wsdl:output message="tns:getSummariesResponse" />
    <wsdl:fault name="AssetException" message="tns:assetException" />
    </wsdl:operation>
    <wsdl:operation name="getTitles" parameterOrder="resourceIdList">
    <wsdl:input message="tns:getTitles" />
    <wsdl:output message="tns:getTitlesResponse" />
    <wsdl:fault name="AssetException" message="tns:assetException" />
    </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="AssetServiceBinding" type="tns:AssetService">
    <wsdl:operation name="getSummary">
    <wsdl:input>
    <soap:header required="true" message="tns:securityHeader" part="credentials" use="literal" actor="security"/>
    <soap:body use="literal"/>
    </wsdl:input>
    <wsdl:output>
    <soap:body use="literal"/>
    </wsdl:output>
    <wsdl:fault name="AssetException">
    <soap:fault name="AssetException" use="literal"/>
    </wsdl:fault>
    <soap:operation soapAction="" />
    </wsdl:operation>
    <wsdl:operation name="getTitle">
    <wsdl:input>
    <soap:header required="true" message="tns:securityHeader" part="credentials" use="literal"/>
    <soap:body use="literal"/>
    </wsdl:input>
    <wsdl:output>
    <soap:body use="literal"/>
    </wsdl:output>
    <wsdl:fault name="AssetException">
    <soap:fault name="AssetException" use="literal"/>
    </wsdl:fault>
    <soap:operation soapAction="" />
    </wsdl:operation>
    <wsdl:operation name="getSummaries">
    <wsdl:input>
    <soap:header required="true" message="tns:securityHeader" part="credentials" use="literal"/>
    <soap:body use="literal"/>
    </wsdl:input>
    <wsdl:output>
    <soap:body use="literal"/>
    </wsdl:output>
    <wsdl:fault name="AssetException">
    <soap:fault name="AssetException" use="literal"/>
    </wsdl:fault>
    <soap:operation soapAction="" />
    </wsdl:operation>
    <wsdl:operation name="getTitles">
    <wsdl:input>
    <soap:header required="true" message="tns:securityHeader" part="credentials" use="literal"/>
    <soap:body use="literal"/>
    </wsdl:input>
    <wsdl:output>
    <soap:body use="literal"/>
    </wsdl:output>
    <wsdl:fault name="AssetException">
    <soap:fault name="AssetException" use="literal"/>
    </wsdl:fault>
    <soap:operation soapAction="" />
    </wsdl:operation>
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
    </wsdl:binding>
    <wsdl:service name="MyAssetService">
    <wsdl:port name="AssetServicePort" binding="tns:AssetServiceBinding">
    <soap:address location="http://localhost:9090/MyAssetWebSvc/asset" />
    </wsdl:port>
    </wsdl:service>
    </wsdl:definitions>
    Here is the wscompile for the server - this is within an ant script that substitutes the variables specified:
    wscompile -keep -d ${path.classes} -s ${src.autojava} -import -model model.gz -f:wsi -f:documentliteral server-config.xml
    and this is the server config:
    <?xml version="1.0" encoding="UTF-8"?>
    <configuration xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/config">
    <wsdl location="file:///C:temp/MyAssetService_wsi.wsdl" packageName="example.com.wsserver.asset.wrapper">
    <handlerChains>
    <chain runAt="server">
    <handler className="example.com.wsserver.security.SecurityServerHandler">
    <property name="name" value="SecurityServerHandler"/>
    </handler>
    </chain>
    </handlerChains>
    </wsdl>
    </configuration>
    On the client side, here is the wscompile, again with ant variable substitution:
    wscompile -gen:client -keep -d ${path.build.wsclient.class} -s ${path.build.wsclient.autojava} -classpath ${path.build.wsclient.class} -f:wsi -f:documentliteral client-config.xml
    And here is the client config:
    <?xml version="1.0" encoding="UTF-8"?>
    <configuration xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/config">
    <wsdl location="file:///C:/temp/MyAssetService_wsi.wsdl" packageName="example.com.wsclient.asset">
    <handlerChains>
    <chain runAt="client">
    <handler className="example.com.wsclient.security.SecurityClientHandler">
    <property name="name" value="SecurityClientHandler"/>
    </handler>
    </chain>
    </handlerChains>
    </wsdl>
    </configuration>
    Note that I generate slightly different packages on client and server side. The server includes a 'wrapper' path on the package name - purely because the
    generated code wrappers an existent api that I am making available as a web service. This is not needed to be seen
    on the client side - i.e. the service appears as is without the wrapper.
    I have tried omitting the documentliteral from the wscompiles and this seems to have no effect.
    Any help gratefully received.
    Best regards
    Lawrence

    Thanks for the prompting. I was convinced that the error was occurring client side as I could see no activity on the server. However having captured the soap request and responses its evident that this is not the case (which I'm a little confused on based on my original tests, but the error makes more sense in this context).
    The request is below:
    <env:Envelope xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns0="http://example.com/myAssetWebSvc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <env:Header>
    <ns1:mmsSecurity env:actor="security" env:mustUnderstand="1" xmlns:ns1="http://example.com/myAssetWebSvc">
    <principal>example.user</principal>
    <password>mypassword</password>
    </ns1:mmsSecurity>
    </env:Header>
    <env:Body>
    <ns0:LongElement>166333</ns0:LongElement>
    </env:Body>
    </env:Envelope>
    I can see from the body that the signature is not unique - its the same as that of the Summary operation. In this case, the server side is performing the summary (rather than the title that I had intended) and returning that response. This gives rise to the deserialisation error on the client side for the response.
    Presumably I need to move to the wrapped document literal style so that the request is uniquely identified on the server side.
    To me this was not an obvious gotcha, Could the parser (wscompile) be enhanced to trap identical request message definitions within a single service/endpoint definition (i.e. WSDL)? If so where should I post the request?

  • DSP Web Service Data Source runtime error "Invalid xsi:type qname"

    I have created a DSP data service that uses a web service as a data source.
    The web service wraps an Oracle PL/SQL package and works when tested independantly of the DSP data service.
    When I test the DSP data service using the weblogic workshop test view I get the error below:
    weblogic.xml.query.exceptions.XQueryDynamicException: {err}XQ0027: Validation failed: error: cvc-elt.4.2: Invalid xsi:type qname: 'ns0:EmpRecUser' in element getEmpResponseElement@http://hr/EmpWebService.wsdl/types/
    (The full stack trace and the WSDL imported into DSP are at the bottom of this posting)
    I am new to DSP but I have created data services from the DSP tutorials succesfully before.
    This is the first data service I have tried to create which is not from a DSP tutorial.
    I dont really understand the error message.
    It appears to me that type EmpRecUser is being prefixed by the wrong name space. In the WSDL the namespace is 'tns:' in the error message the namespace is: 'ns0'.
    <element name="getEmpResponseElement">
    <complexType>
    <sequence>
    <element name="result" type="tns:EmpRecUser" nillable="true"/>
    </sequence>
    </complexType>
    </element>
    I created the web service in Oracle J Developer from the tutorial URL below.
    http://www.oracle.com/technology/obe/obe1013jdev/10131/wsfromplsqlpackage/devwsfrom%20plsql.htm#p
    weblogic.xml.query.exceptions.XQueryDynamicException: {err}XQ0027: Validation failed: error: cvc-elt.4.2: Invalid xsi:type qname: 'ns0:EmpRecUser' in element getEmpResponseElement@http://hr/EmpWebService.wsdl/types/
         at weblogic.xml.query.schema.xmlbeans.XMLValidatorForXMLBeans.giveToken(XMLValidatorForXMLBeans.java:169)
         at weblogic.xml.query.schema.ValidatingIterator.fetchNext(ValidatingIterator.java:148)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:113)
         at com.bea.ld.wrappers.ws.JAXRPCWebserviceIterator.fetchNext(JAXRPCWebserviceIterator.java:104)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:113)
         at weblogic.xml.query.xdbc.iterators.ItemIterator.fetchNext(ItemIterator.java:86)
         at weblogic.xml.query.iterators.GenericIterator.hasNext(GenericIterator.java:134)
         at weblogic.xml.query.runtime.sequences.Subsequence.fetchNext(Subsequence.java:101)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:113)
         at weblogic.xml.query.runtime.querycide.QueryAssassin.fetchNext(QueryAssassin.java:54)
         at weblogic.xml.query.iterators.GenericIterator.peekNext(GenericIterator.java:151)
         at weblogic.xml.query.runtime.qname.InsertNamespaces.fetchNext(InsertNamespaces.java:238)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:113)
         at weblogic.xml.query.runtime.core.QueryIterator.fetchNext(QueryIterator.java:127)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:113)
         at weblogic.xml.query.xdbc.iterators.ItemIterator.fetchNext(ItemIterator.java:86)
         at weblogic.xml.query.iterators.GenericIterator.peekNext(GenericIterator.java:151)
         at weblogic.xml.query.xdbc.util.Serializer.processNamespaces(Serializer.java:340)
         at weblogic.xml.query.xdbc.util.Serializer.processElement(Serializer.java:262)
         at weblogic.xml.query.xdbc.util.Serializer.process(Serializer.java:206)
         at weblogic.xml.query.xdbc.util.Serializer.serializeItems(Serializer.java:152)
    Caused by: weblogic.xml.query.schema.xmlbeans.XMLValidatorForXMLBeans$ValidationException: null
         at weblogic.xml.query.schema.xmlbeans.XMLValidatorForXMLBeans$ExceptionCollection.add(XMLValidatorForXMLBeans.java:340)
         at org.apache.xmlbeans.impl.validator.Validator.emitError(Validator.java:175)
         at org.apache.xmlbeans.impl.validator.Validator.emitFieldError(Validator.java:207)
         at org.apache.xmlbeans.impl.validator.Validator.emitFieldError(Validator.java:193)
         at org.apache.xmlbeans.impl.validator.Validator.beginEvent(Validator.java:458)
         at org.apache.xmlbeans.impl.validator.Validator.nextEvent(Validator.java:246)
         at weblogic.xml.query.schema.xmlbeans.XMLValidatorForXMLBeans.processBeginElementToken(XMLValidatorForXMLBeans.java:1205)
         at weblogic.xml.query.schema.xmlbeans.XMLValidatorForXMLBeans.processToken(XMLValidatorForXMLBeans.java:1322)
         at weblogic.xml.query.schema.xmlbeans.XMLValidatorForXMLBeans.processTokensOnHold(XMLValidatorForXMLBeans.java:1349)
         at weblogic.xml.query.schema.xmlbeans.XMLValidatorForXMLBeans.gotBeginElementToken(XMLValidatorForXMLBeans.java:772)
         at weblogic.xml.query.schema.xmlbeans.XMLValidatorForXMLBeans.giveToken(XMLValidatorForXMLBeans.java:100)
         at weblogic.xml.query.schema.ValidatingIterator.fetchNext(ValidatingIterator.java:148)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:113)
         at com.bea.ld.wrappers.ws.JAXRPCWebserviceIterator.fetchNext(JAXRPCWebserviceIterator.java:104)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:113)
         at weblogic.xml.query.xdbc.iterators.ItemIterator.fetchNext(ItemIterator.java:86)
         at weblogic.xml.query.iterators.GenericIterator.hasNext(GenericIterator.java:134)
         at weblogic.xml.query.runtime.sequences.Subsequence.fetchNext(Subsequence.java:101)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:113)
         at weblogic.xml.query.runtime.querycide.QueryAssassin.fetchNext(QueryAssassin.java:54)
         at weblogic.xml.query.iterators.GenericIterator.peekNext(GenericIterator.java:151)
         at weblogic.xml.query.runtime.qname.InsertNamespaces.fetchNext(InsertNamespaces.java:238)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:113)
         at weblogic.xml.query.runtime.core.QueryIterator.fetchNext(QueryIterator.java:127)
         at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:113)
         at weblogic.xml.query.xdbc.iterators.ItemIterator.fetchNext(ItemIterator.java:86)
         at weblogic.xml.query.iterators.GenericIterator.peekNext(GenericIterator.java:151)
         at weblogic.xml.query.xdbc.util.Serializer.processNamespaces(Serializer.java:340)
         at weblogic.xml.query.xdbc.util.Serializer.processElement(Serializer.java:262)
         at weblogic.xml.query.xdbc.util.Serializer.process(Serializer.java:206)
         at weblogic.xml.query.xdbc.util.Serializer.serializeItems(Serializer.java:152)
         at com.bea.ld.server.QueryInvocation.getResult(QueryInvocation.java:461)
    <definitions
    name="EmpWebService"
    targetNamespace="http://hr/EmpWebService.wsdl"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:tns="http://hr/EmpWebService.wsdl"
    xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
    xmlns:tns0="http://hr/EmpWebService.wsdl/types/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    >
    <types>
    <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://hr/EmpWebService.wsdl/types/"
    elementFormDefault="qualified" xmlns:tns="http://hr/EmpWebService.wsdl/types/"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/">
    <element name="getEmpElement">
    <complexType>
    <sequence>
    <element name="empNo" type="decimal" nillable="true"/>
    </sequence>
    </complexType>
    </element>
    <element name="getEmpResponseElement">
    <complexType>
    <sequence>
    <element name="result" type="tns:EmpRecUser" nillable="true"/>
    </sequence>
    </complexType>
    </element>
    <complexType name="EmpRecUser">
    <complexContent>
    <extension base="tns:EmpRecBase">
    <sequence>
    <element name="departmentId" type="decimal" nillable="true"/>
    <element name="managerId" type="decimal" nillable="true"/>
    <element name="hireDate" type="dateTime" nillable="true"/>
    <element name="jobId" type="string" nillable="true"/>
    <element name="employeeId" type="decimal" nillable="true"/>
    <element name="commissionPct" type="decimal" nillable="true"/>
    <element name="salary" type="decimal" nillable="true"/>
    <element name="lastName" type="string" nillable="true"/>
    </sequence>
    </extension>
    </complexContent>
    </complexType>
    <complexType name="EmpRecBase">
    <sequence/>
    </complexType>
    </schema>
    </types>
    <message name="EmpWebService_getEmp">
    <part name="parameters" element="tns0:getEmpElement"/>
    </message>
    <message name="EmpWebService_getEmpResponse">
    <part name="parameters" element="tns0:getEmpResponseElement"/>
    </message>
    <portType name="EmpWebService">
    <operation name="getEmp">
    <input message="tns:EmpWebService_getEmp"/>
    <output message="tns:EmpWebService_getEmpResponse"/>
    </operation>
    </portType>
    <binding name="EmpWebServiceSoapHttp" type="tns:EmpWebService">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <operation name="getEmp">
    <soap:operation soapAction="http://hr/EmpWebService.wsdl/getEmp"/>
    <input>
    <soap:body use="literal"/>
    </input>
    <output>
    <soap:body use="literal"/>
    </output>
    </operation>
    </binding>
    <service name="EmpWebService">
    <port name="EmpWebServiceSoapHttpPort" binding="tns:EmpWebServiceSoapHttp">
    <soap:address location="http://localhost:8888/PL_SQL_WS-GetEmployee-context-root/EmpWebServiceSoapHttpPort"/>
    </port>
    </service>
    </definitions>

    DSP validates the results from webservices. Whatever you tested the webservice with outside of DSP, probably does not.
    Can you capture the output of the webservice and attach it as well? You can capture the webservice response by running the wls server with the command-line property -Dweblogic.webservice.verbose=true
    Can you also open a case with customer support for this? I will not likely have much time to look at it.
    - Mike
    btw - the namespace prefixes are just place-holders that are defined with xmlns:prefix="some-uri". It is the namespace uri's that must be equivalent. If, in one case you have the definition xmlns:tns="myUri" and in another case xmlns:ns0="myUri" - then tns:EmpRecUser is equivalent to ns0:EmpRecUser.
    Perhaps in the webservice result there is no definition, or an incorrect definition for the namespace prefix ns0 - that would explain the complaint about the QName ns0:EmpRecUser. According to the wsdl, there should be a definition for ns0 as :
    xmlns:ns0="http://hr/EmpWebService.wsdl"
    in the webservice response.

  • Unexpected element name: expected WHEN INVOKING A WEB SERVICE

    I am pretty new to Web Services and need some helping in resolving the following error. I created following two classes and published one of the method savePerson. When I tried to invoke the webservice through my browser passing the following:
    <ns1:savePersonElement xmlns:ns1="http://mypackage17/Person.wsdl/types">
    <ns1:sex>simpleType value</ns1:sex>
    <ns1:human>
    <ns2:last xmlns:ns2="http://tempuri.org">simpleType value</ns2:last>
    <ns3:first xmlns:ns3="http://tempuri.org">simpleType value</ns3:first>
    </ns1:human>
    </ns1:savePersonElement>
    I get the following error:
    <env:Envelope xmlns: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:ns0="http://mypackage17/Person.wsdl/types">
    <env:Body>
    <env:Fault>
    <faultcode>env:Client</faultcode>
    <faultstring>caught exception while handling request: unexpected element name: expected={http://mypackage17/Person.wsdl/types}name, actual={http://mypackage17/Person.wsdl/types}sex</faultstring>
    </env:Fault>
    </env:Body>
    </env:Envelope>
    But passing the following works fine as have passed all the parameters data:
    <ns1:savePersonElement xmlns:ns1="http://mypackage17/Person.wsdl/types">
    <ns1:name>simpleType value</ns1:name>
    <ns1:sex>simpleType value</ns1:sex>
    <ns1:human>
    <ns2:last xmlns:ns2="http://tempuri.org">simpleType value</ns2:last>
    <ns3:first xmlns:ns3="http://tempuri.org">simpleType value</ns3:first>
    </ns1:human>
    </ns1:savePersonElement>
    Here is the code I have for the webservice:
    package mypackage17;
    *@oracle.ws.WebService name = "MyWebService2", serviceName = "MyWebService2", description = "", targetNamespace = "http://tempuri.org", schemaTargetNamespace = "http://mypackage17/Person.wsdl/types", endpointInterface = "mypackage17.MyWebService1SEI"
    *@oracle.ws.SOAPBinding style = "DOCUMENT", use = "LITERAL", documentWrapped = "true", bindingName = "MyWebService1SoapHttp", portName = "MyWebService1Port"
    public class Person extends Human
    private String name;
    private String sex;
    public Person(){}
    public void setName(String name)
    this.name = name;
    public void setSex(String sex)
    this.sex = sex;
    public String getName()
    return this.name;
    public String getSex()
    return this.sex;
    *@oracle.ws.DocumentWrapper requestType = "savePerson", requestElement = "savePersonElement", requestPart = "parameters", responseType = "savePersonResponse", responseElement = "savePersonResponseElement", responsePart = "parameters"
    *@oracle.ws.WebMethod operationName = "savePerson", description = "", oneway = "false", documentWrapped = "true", inputMessage = "MyWebService1SEI_savePerson", outputMessage = "MyWebService1SEI_savePersonResponse", responsePart = "result"
    *@oracle.ws.ParamPart position = "0", partName = "name", mode = "IN", soapHeader = "false"
    *@oracle.ws.ParamPart position = "1", partName = "sex", mode = "IN", soapHeader = "false"
    *@oracle.ws.ParamPart position = "2", partName = "human", mode = "IN", soapHeader = "false"
    public void savePerson(String name, String sex, Human[] human)
    System.out.println("Name: " + name);
    System.out.println("Sex: " + sex);
    System.out.println(human.length);
    System.out.println("1 First: " + human[0].getFirst());
    System.out.println("1 Last: " + human[0].getLast());
    System.out.println("2 First: " + human[1].getFirst());
    System.out.println("2 Last: " + human[1].getLast());
    /****** THE OTHER CLASS ********/
    package mypackage17;
    public class Human
    private String first;
    private String last;
    public Human(){}
    public void setFirst(String first)
    this.first = first;
    public void setLast(String last)
    this.last = last;
    public String getFirst()
    return this.first;
    public String getLast()
    return this.last;
    Here is the WSDL generated using JDeveloper 10.1.3:
    <?xml version="1.0" encoding="UTF-8" ?>
    <definitions
    name="MyWebService2"
    targetNamespace="http://tempuri.org"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:tns="http://tempuri.org"
    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
    xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
    xmlns:ns1="http://mypackage17/Person.wsdl/types"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    >
    <types>
    <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://tempuri.org" elementFormDefault="qualified"
    xmlns:tns="http://tempuri.org" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/">
    <import namespace="http://mypackage17/Person.wsdl/types"/>
    <complexType name="Human">
    <sequence>
    <element name="last" type="string" nillable="true"/>
    <element name="first" type="string" nillable="true"/>
    </sequence>
    </complexType>
    </schema>
    <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://mypackage17/Person.wsdl/types"
    elementFormDefault="qualified" xmlns:tns="http://mypackage17/Person.wsdl/types"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://tempuri.org">
    <import namespace="http://tempuri.org"/>
    <complexType name="savePerson">
    <sequence>
    <element name="name" type="string" nillable="true"/>
    <element name="sex" type="string" nillable="true"/>
    <element name="human" type="ns1:Human" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
    </sequence>
    </complexType>
    <complexType name="savePersonResponse">
    <sequence/>
    </complexType>
    <element name="savePersonElement" type="tns:savePerson"/>
    <element name="savePersonResponseElement" type="tns:savePersonResponse"/>
    </schema>
    </types>
    <message name="MyWebService1SEI_savePerson">
    <part name="parameters" element="ns1:savePersonElement"/>
    </message>
    <message name="MyWebService1SEI_savePersonResponse">
    <part name="parameters" element="ns1:savePersonResponseElement"/>
    </message>
    <portType name="MyWebService2">
    <operation name="savePerson">
    <input message="tns:MyWebService1SEI_savePerson"/>
    <output message="tns:MyWebService1SEI_savePersonResponse"/>
    </operation>
    </portType>
    <binding name="MyWebService1SoapHttp" type="tns:MyWebService2">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <operation name="savePerson">
    <soap:operation soapAction="http://tempuri.org:savePerson"/>
    <input>
    <soap:body use="literal" parts="parameters"/>
    </input>
    <output>
    <soap:body use="literal" parts="parameters"/>
    </output>
    </operation>
    </binding>
    <service name="MyWebService2">
    <port name="MyWebService1Port" binding="tns:MyWebService1SoapHttp">
    <soap:address location="http://192.168.2.101:8988/JavaWebService/MyWebService2"/>
    </port>
    </service>
    </definitions>
    Can someone tell what am I doing wrong. As it looks like I have to pass all the parameters for the method that is published but what if some are missing basically I want to keep all the parameters optional. How can I make the service to return the same what is passed when invoked. Any help is appreciated. I am using JDeveloper 10.1.3.

    To make the service return "whatever is passed", you have to take a step back and realize that there is a little understanding of XML Schema required.
    When using a complexType, which is defined as a sequence, then you are implying an ordered sequence of elements. Default value for the 'minOccurs' attribute is 1. It's also important to understand that there is a difference between minOccurs=0 and nillable="true".
    nillable="true" just means that the name element can carry a null value. If you want the name element to be optional, then you must use the minOccurs=0 and keep the maxOccurs to it's default value of 1. Using an array is just a bad work around. This is for deserialization (XML to JAVA).
    The second part of you problem is on the serialization (or JAVA to XML). When you have a JAVA Bean, there is no way to make the difference between a member's value being null or not set, so it's impossible to decide if you need to send back a nul (xsi:nil="true"), an empty element <ns1:name/> or nothing.
    That said, if you do want to go the XML route, you can use the dataBinding="false" flag in the different WSA command. Instead of converting XML into JAVA, you will have SOAPElement parameters, where you can do all you want (see WS user's guide [1] for details - chapter 16). Note that you have to make sure that the WSDL (your contract) reflect what you are doing on the wire (format of your messages), so that you do not geopardize your interoperability with other toolkit.
    Note that this only applies to literal message formats (use attribute in WSDL), which is your case.
    Hope this helps,
    Eric
    [1] http://download-west.oracle.com/otn_hosted_doc/ias/preview/web.1013/b14434.pdf

  • JAXB: Unexpected element

    Hi there,
    I am using JAXB.
    I have generated java classes by use of xjc. Let's say I have configured to generate the files in the java package "some.package". I use the classes in the following code snipped:
    JAXBContext jc = JAXBContext.newInstance(
         "some.package.simpson.bart:"+
         "some.package.simpson.lisa");
    Unmarshaller unmarshaller = jc.createUnmarshaller();
    Data data= (Data) unmarshaller.unmarshal(new File("c:\\test.xml"));When I try to unmarshall an xml document I get the following error/exception:
    DefaultValidationEventHandler: [ERROR]: Unexpected element {simpson:bart}:Data
    Location: line xx of file:/c:/test.xml
    javax.xml.bind.UnmarshalException: Unexpected element {simpson:bart}:Data
    Can you help me?
    Niko
    I have two related DTDs:
    <xs:schema targetNamespace="simpson:bart" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="simpson:bart" elementFormDefault="qualified">
        <xs:element name="DataType" type="xs:string"/>
    </xs:schema>
    <xs:schema targetNamespace="simpson:lisa" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="simpson:lisa" elementFormDefault="qualified">
         <xs:element name="Data" type="xs:string"/>
    </xs:schema>My test.xml looks like this:
    <Data xmlns="simpson:lisa">
         <DataType xmlns="simpson:bart">someValue</DataType>
    <Data>

    Your schema tells me that the content of elements named "Data" should be of type "xs:string" and thus your instance document is not valid while it contains a nested element named "DataType".
    In order to parse your instance document, you need a schema that defines a complex type for the Data element that allows a nested DataType element... something like this:
    <xs:schema targetNamespace="simpson:lisa" xmlns:bart="simpson:bart" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="simpson:lisa" elementFormDefault="qualified">
      <xs:import namespace="simpson:bart" schemaLocation="bart.xsd"/>
      <xs:element name="Data">
        <xs:complexType>
          <xs:sequence>
            <xs:element ref="bart:DataType"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:schema>

  • Unexpected value type for Item Tag Name ; expected System.Single, received

    Hi,
    I am using PCo 2.1 with MII 12.1 to extract values from some PI tags. When I run the query, I get this error -
    Unexpected value type for Item <Tag Name>; expected System.Single, received System.String[Value = Scan Off]
    Can somebody explain what I need to do to get the correct result?
    Regards,
    Chanti.

    To make the service return "whatever is passed", you have to take a step back and realize that there is a little understanding of XML Schema required.
    When using a complexType, which is defined as a sequence, then you are implying an ordered sequence of elements. Default value for the 'minOccurs' attribute is 1. It's also important to understand that there is a difference between minOccurs=0 and nillable="true".
    nillable="true" just means that the name element can carry a null value. If you want the name element to be optional, then you must use the minOccurs=0 and keep the maxOccurs to it's default value of 1. Using an array is just a bad work around. This is for deserialization (XML to JAVA).
    The second part of you problem is on the serialization (or JAVA to XML). When you have a JAVA Bean, there is no way to make the difference between a member's value being null or not set, so it's impossible to decide if you need to send back a nul (xsi:nil="true"), an empty element <ns1:name/> or nothing.
    That said, if you do want to go the XML route, you can use the dataBinding="false" flag in the different WSA command. Instead of converting XML into JAVA, you will have SOAPElement parameters, where you can do all you want (see WS user's guide [1] for details - chapter 16). Note that you have to make sure that the WSDL (your contract) reflect what you are doing on the wire (format of your messages), so that you do not geopardize your interoperability with other toolkit.
    Note that this only applies to literal message formats (use attribute in WSDL), which is your case.
    Hope this helps,
    Eric
    [1] http://download-west.oracle.com/otn_hosted_doc/ias/preview/web.1013/b14434.pdf

  • Error message : unexpected element name:

    Hi people,
    I'm trying to consume an external web service and encountered the following error when trying to run the service in JDeveloper. I'm new to both java and WSDL. Please lend a helping hand. Thanks for your help in advance.
    Error:
    C:\JDeveloper\jdk\bin\javaw.exe -client -classpath C:\E900\DEMO\Java\classes;C:\JDeveloper\webservices\lib\jaxrpc-api.jar;C:\JDeveloper\webservices\lib\wsclient.jar;C:\JDeveloper\webservices\lib\wsserver.jar;C:\JDeveloper\webservices\lib\wssecurity.jar;C:\JDeveloper\webservices\lib\wsdl.jar;C:\JDeveloper\webservices\lib\orasaaj.jar;C:\JDeveloper\webservices\lib\saaj-api.jar;C:\JDeveloper\webservices\lib\orawsdl.jar;C:\JDeveloper\webservices\lib\orawsrm.jar;C:\JDeveloper\webservices\lib\jaxr_api.jar;C:\JDeveloper\webservices\lib\orajaxr.jar;C:\JDeveloper\webservices\lib\relaxngDatatype.jar;C:\JDeveloper\webservices\lib\jaxb-impl.jar;C:\JDeveloper\webservices\lib\jaxb-libs.jar;C:\JDeveloper\webservices\lib\xsdlib.jar;C:\JDeveloper\webservices\lib\mdds.jar;C:\JDeveloper\jlib\jaxen.jar;C:\JDeveloper\jlib\oraclepki.jar;C:\JDeveloper\jlib\ojpse.jar;C:\JDeveloper\jlib\osdt_core.jar;C:\JDeveloper\jlib\osdt_cert.jar;C:\JDeveloper\jlib\osdt_xmlsec.jar;C:\JDeveloper\jlib\osdt_wss.jar;C:\JDeveloper\jlib\osdt_saml.jar;C:\JDeveloper\jlib\repository.jar;C:\JDeveloper\jlib\ojmisc.jar;C:\JDeveloper\j2ee\home\lib\http_client.jar;C:\JDeveloper\j2ee\home\jazncore.jar;C:\JDeveloper\j2ee\home\oc4jclient.jar;C:\JDeveloper\rdbms\jlib\xdb.jar;C:\JDeveloper\diagnostics\lib\ojdl2.jar;C:\E900\DEMO\ini\sbf;C:\E900\System\Classes\Base_JAR.jar;C:\E900\System\Classes\BizLogicContainer_JAR.jar;C:\E900\System\Classes\BusinessLogicServices_JAR.jar;C:\E900\System\Classes\Connector.jar;C:\E900\System\Classes\EventProcessor_JAR.jar;C:\E900\System\Classes\Generator_JAR.jar;C:\E900\System\Classes\JdbjBase_JAR.jar;C:\E900\System\Classes\JdbjInterfaces_JAR.jar;C:\E900\System\Classes\JdeNet_JAR.jar;C:\E900\System\Classes\Maf2Base_JAR.jar;C:\E900\System\Classes\mafsecurity.jar;C:\E900\System\Classes\Metadata.jar;C:\E900\System\Classes\MetadataInterface.jar;C:\E900\System\Classes\PMApi_JAR.jar;C:\E900\System\Classes\SBFFoundation_JAR.jar;C:\E900\System\Classes\Spec_JAR.jar;C:\E900\System\Classes\System_JAR.jar;C:\E900\System\Classes\SystemInterfaces_JAR.jar;C:\E900\System\Classes\castor.jar;C:\E900\System\Classes\log4j.jar;C:\E900\System\Classes\xerces.jar;C:\E900\System\Classes\xml-apis.jar;C:\E900\System\Classes\Rijndael.jar;C:\E900\System\Classes\ManagementAgent_JAR.jar;C:\E900\System\Classes\commons-logging.jar;C:\E900\System\Classes\commons-codec-1.3.jar;C:\E900\System\Classes\commons-httpclient-3.0.jar;C:\E900\System\Classes\jmxremote.jar;C:\E900\System\Classes\jmxremote_optional.jar;C:\E900\System\Classes\jmxri.jar;C:\E900\System\Classes\rmissl.jar;C:\E900\misc\classes12.jar;C:\E900\misc\mssqlserver.jar;C:\E900\misc\msutil.jar;C:\E900\misc\msbase.jar;C:\E900\misc\db2java.zip;C:\E900\misc\jt400.jar;C:\E900\misc\sqljdbc.jar;C:\E900\misc\ojdbc5.jar;C:\JDeveloper\lib\xmlparserv2.jar;C:\JDeveloper\lib\xml.jar oracle.e1.bssv.J5500002.proxy.CrmCustomerServiceClient
    calling http://XXX.XX.XXX.XX:8080/PSIGW/HttpListeningConnector
    *unexpected element name: expected={http://xxxx.xxxx.com}EnquiryByLegacyIdResponse, actual=EnquiryByLegacyIdResponse*
    at oracle.j2ee.ws.common.encoding.literal.LiteralObjectSerializerBase.internalDeserialize(LiteralObjectSerializerBase.java:231)
    at oracle.j2ee.ws.common.encoding.literal.LiteralObjectSerializerBase.deserialize(LiteralObjectSerializerBase.java:159)
    at oracle.e1.bssv.J5500002.proxy.runtime.CrmCustomerServiceSoapBinding_Stub._deserialize_EnquiryByLegacyId(CrmCustomerServiceSoapBinding_Stub.java:348)
    at oracle.e1.bssv.J5500002.proxy.runtime.CrmCustomerServiceSoapBinding_Stub._readFirstBodyElement(CrmCustomerServiceSoapBinding_Stub.java:283)
    at oracle.j2ee.ws.client.StreamingSender._sendImpl(StreamingSender.java:335)
    at oracle.j2ee.ws.client.StreamingSender._send(StreamingSender.java:114)
    at oracle.e1.bssv.J5500002.proxy.runtime.CrmCustomerServiceSoapBinding_Stub.enquiryByLegacyId(CrmCustomerServiceSoapBinding_Stub.java:238)
    at oracle.e1.bssv.J5500002.proxy.CrmCustomerServiceClient.enquiryByLegacyId(CrmCustomerServiceClient.java:55)
    at oracle.e1.bssv.J5500002.proxy.CrmCustomerServiceClient.main(CrmCustomerServiceClient.java:41)
    Process exited with exit code 0.
    --- the definition for java class "CrmCustomerServiceClient.java" ---_*
    package oracle.e1.bssv.J5500002.proxy;
    import oracle.webservices.transport.ClientTransport;
    import oracle.webservices.OracleStub;
    import javax.xml.rpc.ServiceFactory;
    import javax.xml.rpc.Stub;
    public class CrmCustomerServiceClient {
    private oracle.e1.bssv.J5500002.proxy.CrmCustomerService _port;
    public CrmCustomerServiceClient() throws Exception {
    ServiceFactory factory = ServiceFactory.newInstance();
    _port = ((oracle.e1.bssv.J5500002.proxy.CrmCustomerServiceService)factory.loadService(oracle.e1.bssv.J5500002.proxy.CrmCustomerServiceService.class)).getCrmCustomerService();
    * @param args
    public static void main(String[] args) {
    try {
    oracle.e1.bssv.J5500002.proxy.CrmCustomerServiceClient myPort = new oracle.e1.bssv.J5500002.proxy.CrmCustomerServiceClient();
    System.out.println("calling " + myPort.getEndpoint());
    // Add your own code here
    EnquiryByLegacyId test = new EnquiryByLegacyId ();
    test.setSETID("CTN");
    test.setCPL_LEGACY_ID("03-135452");
    //EnquiryByLegacyIdResponse response = new EnquiryByLegacyIdResponse();
    //response = myPort.enquiryByLegacyId(test);
    //EnquiryByLegacyIdResponse response = myPort.enquiryByLegacyId(test);
    CrmCustomerId cus = new CrmCustomerId();
    //cus = response.getEnquiryByLegacyIdReturn();
    cus = (myPort.enquiryByLegacyId(test)).getEnquiryByLegacyIdReturn();
    System.out.println("Your username is " + cus.getCUST_ID()+cus.getRESPOND_MSG());
    } catch (Exception ex) {
    ex.printStackTrace();
    * delegate all operations to the underlying implementation class.
    public EnquiryByLegacyIdResponse enquiryByLegacyId(EnquiryByLegacyId parameters) throws java.rmi.RemoteException {
    return _port.enquiryByLegacyId(parameters);
    public EnquiryByNationalIdResponse enquiryByNationalId(EnquiryByNationalId parameters) throws java.rmi.RemoteException {
    return _port.enquiryByNationalId(parameters);
    public EnquiryByNameResponse enquiryByName(EnquiryByName parameters) throws java.rmi.RemoteException {
    return _port.enquiryByName(parameters);
    public EnquiryByPhoneCellResponse enquiryByPhoneCell(EnquiryByPhoneCell parameters) throws java.rmi.RemoteException {
    return _port.enquiryByPhoneCell(parameters);
    * used to access the JAX-RPC level APIs
    * returns the interface of the port instance
    public oracle.e1.bssv.J5500002.proxy.CrmCustomerService getPort() {
    return _port;
    public String getEndpoint() {
    return (String) ((Stub) port).getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY);
    public void setEndpoint(String endpoint) {
    ((Stub) port).setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, endpoint);
    public String getPassword() {
    return (String) ((Stub) port).getProperty(Stub.PASSWORD_PROPERTY);
    public void setPassword(String password) {
    ((Stub) port).setProperty(Stub.PASSWORD_PROPERTY, password);
    public String getUsername() {
    return (String) ((Stub) port).getProperty(Stub.USERNAME_PROPERTY);
    public void setUsername(String username) {
    ((Stub) port).setProperty(Stub.USERNAME_PROPERTY, username);
    public void setMaintainSession(boolean maintainSession) {
    ((Stub) port).setProperty(Stub.SESSION_MAINTAIN_PROPERTY, Boolean.valueOf(maintainSession));
    public boolean getMaintainSession() {
    return ((Boolean) ((Stub) port).getProperty(Stub.SESSION_MAINTAIN_PROPERTY)).booleanValue();
    * returns the transport context
    public ClientTransport getClientTransport() {
    return ((OracleStub) _port).getClientTransport();
    --- the definition for java class "EnquiryByLegacyIdResponse.java" ---_*
    package oracle.e1.bssv.J5500002.proxy;
    public class EnquiryByLegacyIdResponse implements java.io.Serializable {
    protected oracle.e1.bssv.J5500002.proxy.CrmCustomerId enquiryByLegacyIdReturn;
    public EnquiryByLegacyIdResponse() {
    public oracle.e1.bssv.J5500002.proxy.CrmCustomerId getEnquiryByLegacyIdReturn() {
    return enquiryByLegacyIdReturn;
    public void setEnquiryByLegacyIdReturn(oracle.e1.bssv.J5500002.proxy.CrmCustomerId enquiryByLegacyIdReturn) {
    this.enquiryByLegacyIdReturn = enquiryByLegacyIdReturn;
    __--- the definition for the WSDL" ---__+
    <?xml version="1.0" encoding="UTF-8"?>
    <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://xxxx.xxxx.com" xmlns:intf="http://xxxx.xxxx.com" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://xxxx.xxxx.com">
    <!--WSDL created by Apache Axis version: 1.3
    Built on Oct 05, 2005 (05:23:37 EDT)-->
    <wsdl:types>
    <schema xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://xxxx.xxxx.com">
    <element name="EnquiryByLegacyId">
    <complexType>
    <sequence>
    <element name="SETID" type="xsd:string" />
    <element name="CPL_LEGACY_ID" type="xsd:string"/>
    </sequence>
    </complexType>
    </element>
    <element name="EnquiryByLegacyIdResponse">
    <complexType>
    <sequence>
    <element name="EnquiryByLegacyIdReturn" type="impl:CrmCustomerId"/>
    </sequence>
    </complexType>
    </element>
    <complexType name="CrmCustomerId">
    <sequence>
    <element name="SETID" nillable="false" type="xsd:string"/>
    <element name="CPL_LEGACY_ID" nillable="true" type="xsd:string"/>
    <element name="CUST_ID" nillable="true" type="xsd:string"/>
    <element name="RESPOND_MSG" nillable="false" type="xsd:integer"/>
    </sequence>
    </complexType>
    <element name="EnquiryByNationalId">
    <complexType>
    <sequence>
    <element name="SETID" type="xsd:string"/>
    <element name="NATIONAL_ID" type="xsd:string"/>
    </sequence>
    </complexType>
    </element>
    <element name="EnquiryByNationalIdResponse">
    <complexType>
    <sequence>
    <element name="EnquiryByNationalIdReturn" type="impl:CrmCustomerId"/>
    </sequence>
    </complexType>
    </element>
    <complexType name="CrmCustomerId">
    <sequence>
    <element name="SETID" nillable="false" type="xsd:string"/>
    <element name="CPL_LEGACY_ID" nillable="true" type="xsd:string"/>
    <element name="CUST_ID" nillable="true" type="xsd:string"/>
    <element name="RESPOND_MSG" nillable="false" type="xsd:integer"/>
    </sequence>
    </complexType>
    <element name="EnquiryByName">
    <complexType>
    <sequence>
    <element name="SETID" type="xsd:string"/>
    <element name="LAST_NAME" type="xsd:string"/>
    <element name="FIRST_NAME" type="xsd:string"/>
    <element name="ADDRESS1" type="xsd:string"/>
    </sequence>
    </complexType>
    </element>
    <element name="EnquiryByNameResponse">
    <complexType>
    <sequence>
    <element name="EnquiryByNameReturn" type="impl:CrmCustomerId"/>
    </sequence>
    </complexType>
    </element>
    <complexType name="CrmCustomerId">
    <sequence>
    <element name="SETID" nillable="false" type="xsd:string"/>
    <element name="CPL_LEGACY_ID" nillable="true" type="xsd:string"/>
    <element name="CUST_ID" nillable="true" type="xsd:string"/>
    <element name="RESPOND_MSG" nillable="false" type="xsd:integer"/>
    </sequence>
    </complexType>
    <element name="EnquiryByPhoneCell">
    <complexType>
    <sequence>
    <element name="SETID" type="xsd:string" />
    <element name="PHONE_CELL" type="xsd:string"/>
    </sequence>
    </complexType>
    </element>
    <element name="EnquiryByPhoneCellResponse">
    <complexType>
    <sequence>
    <element name="EnquiryByPhoneCellReturn" type="impl:CrmCustomerId"/>
    </sequence>
    </complexType>
    </element>
    <complexType name="CrmCustomerId">
    <sequence>
    <element name="SETID" nillable="false" type="xsd:string"/>
    <element name="CPL_LEGACY_ID" nillable="true" type="xsd:string"/>
    <element name="CUST_ID" nillable="true" type="xsd:string"/>
    <element name="RESPOND_MSG" nillable="false" type="xsd:integer"/>
    </sequence>
    </complexType>
    </schema>
    </wsdl:types>
    <wsdl:message name="EnquiryByLegacyIdRequest">
    <wsdl:part element="intf:EnquiryByLegacyId" name="parameters"/>
    </wsdl:message>
    <wsdl:message name="EnquiryByLegacyIdResponse">
    <wsdl:part element="intf:EnquiryByLegacyIdResponse" name="parameters"/>
    </wsdl:message>
    <wsdl:message name="EnquiryByNationalIdRequest">
    <wsdl:part element="intf:EnquiryByNationalId" name="parameters"/>
    </wsdl:message>
    <wsdl:message name="EnquiryByNationalIdResponse">
    <wsdl:part element="intf:EnquiryByNationalIdResponse" name="parameters"/>
    </wsdl:message>
    <wsdl:message name="EnquiryByNameRequest">
    <wsdl:part element="intf:EnquiryByName" name="parameters"/>
    </wsdl:message>
    <wsdl:message name="EnquiryByNameResponse">
    <wsdl:part element="intf:EnquiryByNameResponse" name="parameters"/>
    </wsdl:message>
    <wsdl:message name="EnquiryByPhoneCellRequest">
    <wsdl:part element="intf:EnquiryByPhoneCell" name="parameters"/>
    </wsdl:message>
    <wsdl:message name="EnquiryByPhoneCellResponse">
    <wsdl:part element="intf:EnquiryByPhoneCellResponse" name="parameters"/>
    </wsdl:message>
    <wsdl:portType name="CrmCustomerService">
    <wsdl:operation name="EnquiryByLegacyId">
    <wsdl:input message="intf:EnquiryByLegacyIdRequest" name="EnquiryByLegacyIdRequest"/>
    <wsdl:output message="intf:EnquiryByLegacyIdResponse" name="EnquiryByLegacyIdResponse"/>
    </wsdl:operation>
    <wsdl:operation name="EnquiryByNationalId">
    <wsdl:input message="intf:EnquiryByNationalIdRequest" name="EnquiryByNationalIdRequest"/>
    <wsdl:output message="intf:EnquiryByNationalIdResponse" name="EnquiryByNationalIdResponse"/>
    </wsdl:operation>
    <wsdl:operation name="EnquiryByName">
    <wsdl:input message="intf:EnquiryByNameRequest" name="EnquiryByNameRequest"/>
    <wsdl:output message="intf:EnquiryByNameResponse" name="EnquiryByNameResponse"/>
    </wsdl:operation>
    <wsdl:operation name="EnquiryByPhoneCell">
    <wsdl:input message="intf:EnquiryByPhoneCellRequest" name="EnquiryByPhoneCellRequest"/>
    <wsdl:output message="intf:EnquiryByPhoneCellResponse" name="EnquiryByPhoneCellResponse"/>
    </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="CrmCustomerServiceSoapBinding" type="intf:CrmCustomerService">
    <wsdlsoap:binding style=""/>
    <wsdl:operation name="EnquiryByLegacyId">
    <wsdlsoap:operation soapAction="#CPL_LEGACY_ID_ENQ#CCH_TEST"/>
    <wsdl:input name="EnquiryByLegacyIdRequest">
    <wsdlsoap:body use="literal"/>
    </wsdl:input>
    <wsdl:output name="EnquiryByLegacyIdResponse">
    <wsdlsoap:body use="literal"/>
    </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="EnquiryByNationalId">
    <wsdlsoap:operation soapAction="#CPL_NATIONAL_ID_ENQ#CCH_TEST"/>
    <wsdl:input name="EnquiryByNationalIdRequest">
    <wsdlsoap:body use="literal"/>
    </wsdl:input>
    <wsdl:output name="EnquiryByNationalIdResponse">
    <wsdlsoap:body use="literal"/>
    </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="EnquiryByName">
    <wsdlsoap:operation soapAction="#CPL_NAME_ENQ#CCH_TEST"/>
    <wsdl:input name="EnquiryByNameRequest">
    <wsdlsoap:body use="literal"/>
    </wsdl:input>
    <wsdl:output name="EnquiryByNameResponse">
    <wsdlsoap:body use="literal"/>
    </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="EnquiryByPhoneCell">
    <wsdlsoap:operation soapAction="#CPL_PHONE_CELL_ENQ#CCH_TEST"/>
    <wsdl:input name="EnquiryByPhoneCellRequest">
    <wsdlsoap:body use="literal"/>
    </wsdl:input>
    <wsdl:output name="EnquiryByPhoneCellResponse">
    <wsdlsoap:body use="literal"/>
    </wsdl:output>
    </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="CrmCustomerServiceService">
    <wsdl:port binding="intf:CrmCustomerServiceSoapBinding" name="CrmCustomerService">
    <wsdlsoap:address location="http://XXX.XX.XXX.XX:8080/PSIGW/HttpListeningConnector"/>
    </wsdl:port>
    </wsdl:service>
    </wsdl:definitions>

    I do not understand this WSDL! Its wrong!!
    For e.g. why is this section repeated so many times:
    <complexType name="CrmCustomerId">
    <sequence>
    <element name="SETID" nillable="false" type="xsd:string"/>
    <element name="CPL_LEGACY_ID" nillable="true" type="xsd:string"/>
    <element name="CUST_ID" nillable="true" type="xsd:string"/>
    <element name="RESPOND_MSG" nillable="false" type="xsd:integer"/>
    </sequence>
    </complexType>
    Also when creating what mapping did you choose? JAX-B or JAX-RPC?
    Try JAX-B.
    Venkat

  • Unexpected element: CDATA

    Hi,
    I am using XMLBeans to parse an XML file and do some processing. I have created
    the xsd file and generated the beans. In my code i get an Unexpected element:
    CDATA exception during the XXX.Factory.parse(String filename) method.
    The code to parse the file is as follows:-
    PlatformDocument pDoc = PlatformDocument.Factory.parse("platform.xml");
    The exception thrown is:-
    javax.servlet.ServletException: StartupInitializer Parse Exception: error: Unexpected
    element: CDATA
    at com.nokia.npp.serlvet.init.StartupInitializer.init(StartupInitializer.java:89)
    at weblogic.servlet.internal.ServletStubImpl$ServletInitAction.run(ServletStubImpl.java:993)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
    at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java:869)
    at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImpl.java:848)
    at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:787)
    at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:3252)
    at weblogic.servlet.internal.WebAppServletContext.preloadServlets(WebAppServletContext.java:3197)
    at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:3174)
    at weblogic.servlet.internal.WebAppServletContext.setStarted(WebAppServletContext.java:5647)
    at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:869)
    at weblogic.j2ee.J2EEApplicationContainer.start(J2EEApplicationContainer.java:2022)
    at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:2063)
    at weblogic.management.deploy.slave.SlaveDeployer$ComponentActivateTask.activateContainer(SlaveDeployer.java:2592)
    at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.doCommit(SlaveDeployer.java:2515)
    at weblogic.management.deploy.slave.SlaveDeployer$Task.commit(SlaveDeployer.java:2317)
    at weblogic.management.deploy.slave.SlaveDeployer$Task.checkAutoCommit(SlaveDeployer.java:2399)
    at weblogic.management.deploy.slave.SlaveDeployer$Task.prepare(SlaveDeployer.java:2311)
    at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.java:2479)
    at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:798)
    at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:507)
    at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:465)
    at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    The xml file is attached to this post. The XSD is shown below:-
    <?xml version="1.0"?>
    <xs:schema
         xmlns:xs="http://www.w3.org/2001/XMLSchema"
         xmlns:npp="http://xml.npp.nokia.com/platform.xsd"
         targetNamespace="http://xml.npp.nokia.com/platform.xsd"
         elementFormDefault="qualified"
         attributeFormDefault="unqualified">
    <xs:element name="platform">
    <xs:complexType>
    <xs:sequence>
    <xs:element ref="npp:startup-classes" maxOccurs="1"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    <xs:element name="startup-classes">
    <xs:complexType>
    <xs:sequence>
    <xs:element ref="npp:start-up" maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    <xs:element name="start-up">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="description" type="xs:string" minOccurs="0"/>
    <xs:element name="class-name" type="xs:string" maxOccurs="1"/>
    <xs:element name="init-param" minOccurs="0" maxOccurs="unbounded">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="param-name" type="xs:string" minOccurs="1"
    maxOccurs="1"/>
    <xs:element name="param-value" type="xs:string" minOccurs="1"
    maxOccurs="1"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    <xs:element name="scheduler">
    <xs:complexType>
    <xs:sequence>
    <xs:element ref="npp:scheduler" maxOccurs="1"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:schema>
    Any help apprceciated...
    Thanks
    Martin
    [platform.xml]

    I managed to fix this issue by passing a File object to the parse method instead
    of the String for the file name as below:-
    File xmlFile = new File("platform.xml");
    PlatformDocument pDoc = PlatformDocument.Factory.parse(xmlFile);
    "Martin Porter" <[email protected]> wrote:
    >
    >
    >
    Hi,
    I am using XMLBeans to parse an XML file and do some processing. I have
    created
    the xsd file and generated the beans. In my code i get an Unexpected
    element:
    CDATA exception during the XXX.Factory.parse(String filename) method.
    The code to parse the file is as follows:-
    PlatformDocument pDoc = PlatformDocument.Factory.parse("platform.xml");
    The exception thrown is:-
    javax.servlet.ServletException: StartupInitializer Parse Exception: error:
    Unexpected
    element: CDATA
    at com.nokia.npp.serlvet.init.StartupInitializer.init(StartupInitializer.java:89)
    at weblogic.servlet.internal.ServletStubImpl$ServletInitAction.run(ServletStubImpl.java:993)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
    at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java:869)
    at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImpl.java:848)
    at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:787)
    at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:3252)
    at weblogic.servlet.internal.WebAppServletContext.preloadServlets(WebAppServletContext.java:3197)
    at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:3174)
    at weblogic.servlet.internal.WebAppServletContext.setStarted(WebAppServletContext.java:5647)
    at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:869)
    at weblogic.j2ee.J2EEApplicationContainer.start(J2EEApplicationContainer.java:2022)
    at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:2063)
    at weblogic.management.deploy.slave.SlaveDeployer$ComponentActivateTask.activateContainer(SlaveDeployer.java:2592)
    at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.doCommit(SlaveDeployer.java:2515)
    at weblogic.management.deploy.slave.SlaveDeployer$Task.commit(SlaveDeployer.java:2317)
    at weblogic.management.deploy.slave.SlaveDeployer$Task.checkAutoCommit(SlaveDeployer.java:2399)
    at weblogic.management.deploy.slave.SlaveDeployer$Task.prepare(SlaveDeployer.java:2311)
    at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.java:2479)
    at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:798)
    at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:507)
    at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:465)
    at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    The xml file is attached to this post. The XSD is shown below:-
    <?xml version="1.0"?>
    <xs:schema
         xmlns:xs="http://www.w3.org/2001/XMLSchema"
         xmlns:npp="http://xml.npp.nokia.com/platform.xsd"
         targetNamespace="http://xml.npp.nokia.com/platform.xsd"
         elementFormDefault="qualified"
         attributeFormDefault="unqualified">
    <xs:element name="platform">
    <xs:complexType>
    <xs:sequence>
    <xs:element ref="npp:startup-classes" maxOccurs="1"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    <xs:element name="startup-classes">
    <xs:complexType>
    <xs:sequence>
    <xs:element ref="npp:start-up" maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    <xs:element name="start-up">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="description" type="xs:string" minOccurs="0"/>
    <xs:element name="class-name" type="xs:string" maxOccurs="1"/>
    <xs:element name="init-param" minOccurs="0" maxOccurs="unbounded">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="param-name" type="xs:string"
    minOccurs="1"
    maxOccurs="1"/>
    <xs:element name="param-value" type="xs:string"
    minOccurs="1"
    maxOccurs="1"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    <xs:element name="scheduler">
    <xs:complexType>
    <xs:sequence>
    <xs:element ref="npp:scheduler" maxOccurs="1"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:schema>
    Any help apprceciated...
    Thanks
    Martin

  • How to extract an element value from a String of HTML

    I have a web service that returns a fragment of HTML that contains a number in a table. The return parameter type is a string. I need to get this number and use it in a BPEL while loop, as the condition for the loop (while the number > 0).
    I have tried using the function bpws:getVariableData() but the BPEL PM faults and says: XPath expression failed to execute. Error while processing xpath expression. I think this is because I am trying to apply an XPath expression over a String variable.
    The return value from my web service looks like this:
    <whileConditionResultSet>
    <part xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" name="response">
    <ns1:string_Response xmlns:ns1="http://systinet.com/xsd/SchemaTypes/"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="d:string">
         <p>SQL Query: select count(*) from delta_manages</p>
         <p><table border='1'>
              <tr> <th bgcolor='#C0C0C0'>COUNT(*)</th></tr>
              <tr> <td>28</td></tr>
              </table>
         </p></ns1:string_Response>
    </part>
    </whileConditionResultSet>
    How do I get the value from the HTML table into a BPEL variable?

    the doSqlService() which executes an arbitrary SQL statement, returns a string of HTML like this:
    <doSqlServiceResponse>
    <part xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" name="response">
    <ns1:string_Response xmlns:ns1="http://systinet.com/xsd/SchemaTypes/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="d:string"><p>SQL Query: select count(*) from delta_manages</p> <p><table border='1'> <tr> <th bgcolor='#C0C0C0'>COUNT(*)</th></tr> <tr> <td>14</td></tr> </table></p></ns1:string_Response>
    </part>
    I then copy the result to the whileResultString variable
    <variable name="whileResultString" type="xsd:string"/>
    <copy>
                                       <from variable="doSqlServiceResponse" part="response" query="/ns1:string_Response">
                                       </from>
                                       <to variable="whileResultString"/>
                                  </copy>
    I realise too, a root element will be needed. This is not a mission critical problem as we could change the web service at the other end. It was originally designed for a client to display the results rather than use them within a business process. Anyway, I'm just interested to know if I can create a node from this string data in BPEL.
    Ross.

  • How to change elements in ArrayList into String

    Greetings,
    i like to change elements in arrayList into string.
    This is how i declare an ArrayList in a Java file
    ArrayList listing = new ArrayList();below is just a simple example of how i insert the string into the arraylist
    String concat = "';
    concat = concat + "apple";
    //Transfer the concat string into arraylist
    listing.add(concat);
    return listing;
    {code}
    On my Jsp page, it will receive the ArrayList from the java file. Lets say the Arrayist is pass into my JSP arraylist
    This is my JSP arraylist
    {code}ArrayList optLists = new ArrayList();{code}
    Inside the arraylist element, it holds data eg: *308577;;RS | [CAT 2] Level: Arena, Section: A02* with a pipe between RS and CAT 2.
    Now i looping the arraylist
    {code}int a = 0;
         for ( a=0; a < optLists.size(); a++)
              String tempString = "";
              String splitTemp = "";
                     String tempString = (String)optLists.get(a);
              splitTemp =  tempString.split("|");
              System.out.println("Split String Results: "+ splitTemp);
         {code}}
    Heres the error:
    *SeatAvailable_jsp.java:560: incompatible types*
        *[javac] found   : java.lang.String[]*
        *[javac] required: java.lang.String*
        *[javac]             splitTemp =  tempString.split("|");*
        *[javac]*       
    What can i do to solve the problem?
    Edited by: leeChaolan on May 2, 2008 4:45 AM
    Edited by: leeChaolan on May 2, 2008 4:48 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    paternostro is right, you are returning an array into a string which is wrong
    but try this, i haven't tested it though..
    nt a = 0;
         for ( a=0; a < optLists.size(); a++)
              String tempString = "";
              String splitTemp = "";
                     String tempString = (String)optLists.get(a);
              String[] splitTemp =  tempString.split("|");
              for(String xyz : splitTemp)
                   System.out.println("Split String Results: "+ xyz);
         }Edited by: linker on May 2, 2008 1:17 PM
    Edited by: linker on May 2, 2008 1:18 PM

  • DefaultValidationEventHandler: [ERROR]: Unexpected element {}:Key

    When I tried to unmarshal the xml string to Jaxb generated java object I got following error:
    DefaultValidationEventHandler: [ERROR]: Unexpected element {}:Key
    Anyone has any idea about this?
    I greatly appreciate your thoughts!
    JAXBContext jc = JAXBContext.newInstance(feedXsd);
    Unmarshaller unmarshaller = jc.createUnmarshaller();
    ContentEnvelope contentEnvelope =(ContentEnvelope) unmarshaller.unmarshal(new StreamSource(new StringReader(feedStr)));
    vini

    Just would like to share with you -- I found what caused the exception thrown. My xml file is too big. After I resize the xml file it is working.
    vini

  • UnmarshalException: unexpected element (uri:...

    Hello,
    I have an ugly problem while trying to unmarshal my xml-instance with JAXB (WSDP2.0). I hope that you may help.
    With the tool XJC I have generated some Java-classes from XML-Schema
    xjc.bat -debug -readOnly -b myBindingFile.xjb -extension -d ./java xsd\MyMainSchema.xsd>error.txtThere was no error message, so I thought that everything was fine
    The file MyMainSchema.xsd uses/imports several other XML-Schemas.
    Among other imported elements I am using some elements of OGC (GML3.1.1,Geography Markup Language) for example gml:Polygon.
    Schema:
    <xsd:schema xmlns="my:package:structure:MyRoot"
    xmlns:x="...."
    xmlns:y="...."
    xmlns:xlink="http://www.w3.org/1999/xlink"
    xmlns:gml="http://www.opengis.net/gml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="my:package:structure:MyRoot"
    elementFormDefault="qualified"
    attributeFormDefault="unqualified"
    version="0.1">
    <xsd:import namespace="x" schemaLocation="../x.xsd"/>
    <xsd:import namespace="y" schemaLocation="../y.xsd"/>
    <xsd:element name="MyRoot" type="MyRootType"/>
    <xsd:complexType name="MyRootType">
    <xsd:sequence>
       <xsd:element ref="x:element1" minOccurs="0"/>
       <xsd:element ref="y:element2" minOccurs="0"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:schema>element2 contains on lower level some GML-elements
    If I generate a valide instance of the schema and try to unmarshal (Schema->java-classes, I have done this in the following way:
    JAXBContext jc = JAXBContext.newInstance(my.package.structure.MyRootType.class);
    Unmarshaller u = jc.createUnmarshaller();
    FileInputStream f_in = new FileInputStream("C://my/path/to/instance/instance.xml"");      
    MyRootType doc = (MyRootType)u.unmarshal(f_in);Now I get an error message:
    javax.xml.bind.UnmarshalException: unexpected element (uri:"my:package:structure:MyRootType", local:"MyRoot").
    Expected elements are
    <{http://www.opengis.net/gml}Array>,
    <{http://www.opengis.net/gml}Bag>,
    <{http://www.opengis.net/gml}BaseUnit>,
    <{http://www.opengis.net/gml}validTime>,
    <{http://www.opengis.net/gml}vector>Can anybody please help and tell me where I may search for the error. I tried several hours to eliminate the error, but all without success.
    It seems that JAXB is searching for an element out of the GML-namespace but I don't understand why.
    the y:element2 contains a gml:Polygon, but I think that this can not be the cause
    Thanks a lot for your help!
    tine

    xsi:noNamespaceSchemaLocation="F:\Data\NetBeansProjects\834Parser\data\enrollmentschema.xsd"I did some googling; all of the examples of the xsi:noNamespaceSchemaLocation I found were too simple. But eventually I found a document which suggested that the value of this attribute should be a URI. Which makes sense since the schema specs were written by the W3C for use in Internet applications. And you haven't provided a URI there.

  • Error 103: application.version is an unexpected element/attribute

    Hi guys, while i'm publishing iOS app from Flash, i get that thing
    Unexpected or unknown element or attribute in the application descriptor file.
    /Users/stockingem/Documents/DWP/1-app.xml(44): error 103: application.version is an unexpected element/attribute
    application.version is an unexpected element/attribute
    please, help to solve it!

    <?xml version="1.0" encoding="utf-8"?>
    <application xmlns="http://ns.adobe.com/air/application/2.6">
        <id>test1</id>
        <versionNumber>1.2.0</versionNumber>
        <filename>Untitled-1</filename>
        <description></description>
        <!-- To localize the description, use the following format for the description element.
        <description>
            <text xml:lang="en">English App description goes here</text>
            <text xml:lang="fr">French App description goes here</text>
            <text xml:lang="ja">Japanese App description goes here</text>
        </description>
        -->
        <name>Untitled-1</name>
        <!-- To localize the name, use the following format for the name element.
        <name>
            <text xml:lang="en">English App name goes here</text>
            <text xml:lang="fr">French App name goes here</text>
            <text xml:lang="ja">Japanese App name goes here</text>
        </name>
        -->
        <copyright></copyright>
        <initialWindow>
            <content>Untitled-1.swf</content>
            <systemChrome>standard</systemChrome>
            <transparent>false</transparent>
            <visible>true</visible>
            <fullScreen>true</fullScreen>
            <autoOrients>false</autoOrients>
            <aspectRatio>portrait</aspectRatio>
            <renderMode>auto</renderMode>
        </initialWindow>
        <customUpdateUI>false</customUpdateUI>
        <allowBrowserInvocation>false</allowBrowserInvocation>
        <icon>
            <image29x29>AppIconsForPublish/dwp.png</image29x29>
        </icon>
        <iPhone>
            <requestedDisplayResolution>standard</requestedDisplayResolution>
            <InfoAdditions><![CDATA[<key>UIDeviceFamily</key><array><string>1</string></array>]]></In foAdditions>
        </iPhone>
        <version>1.2</version>
    </application>

  • Entitlements in file Descriptor : Error 103 "application.iPhone.Entitlements..unexpected elements"

    Hi,
    I need to set Entitlements key in file descriptor.
    If i include <Entitlements> section ADT says "error 103: application.iPhone.Entitlements is an unexpected element/attribute" !!
    But in documentation there is this Element : http://help.adobe.com/en_US/air/build/WSfffb011ac560372f2fea1812938a6e463-8000.html#WSd6d4 f896b3a8801b-3c9d92f81393051c54c-8000
    My File Descriptor (without <Entitlements> section it works good):
    <?xml version="1.0" encoding="utf-8" ?>
    <application xmlns="http://ns.adobe.com/air/application/3.0">
        <id>com.truc.test2</id>
        <name>Hello World iOS</name>
        <versionNumber>1.0.1</versionNumber>
        <filename>Comp1</filename>
        <supportedProfiles>mobileDevice</supportedProfiles>
        <initialWindow>
            <content>CompIPad.swf</content>
            <title>Comp1</title>
        </initialWindow>
        <iPhone>
                 <Entitlements>
                    <![CDATA[
                       <key>aps-environment</key>
                       <string>development</string>
                    ]]>
                 </Entitlements>
                           <InfoAdditions>
                                      <![CDATA[
                                                                <key>UIDeviceFamily</key>
                                                                <array>
                                                                    <string>2</string>
                                                                </array>
                                      ]]>
                                  </InfoAdditions>
                                  <requestedDisplayResolution>high</requestedDisplayResolution>
                         </iPhone>
        <icon>
            <image29x29>icons/icon_29.png</image29x29>
            <image57x57>icons/icon_57.png</image57x57>
            <image72x72>icons/icon_72.png</image72x72>
            <image512x512>icons/icon_512.png</image512x512>
        </icon>
    </application>
    How can i do ?
    Regards
    System: Windows Seven
    Trying with Adobe Air SDK 3.4 and 3.5 beta (same problem)

    Entitlements tag was introduced in namespace 3.1. Please update your app descriptor to use namespace 3.1 or above.
    <application xmlns="http://ns.adobe.com/air/application/3.1">
    -Neha

  • Getting error while creating the variable of Schema Element type

    Hi everybody,
    For creating a variable of schema element type I am doing the following steps...
    Select 'Variables' after right clicking on bpel process. IN this window, go to 'Create VAriable' then select 'Element' type. Now in Type Choose, I expanded the my imported schema files. And selected a element type, then click ok to create this variable... I am getting the message...
    IN ORDER TO SAVE IMPORTED WSDL/SCHEMA FILES, YOU MUST HAVE A PARTNER LINK LOCATED UNDER THE CURRENT PROJECT DIRECTORY.
    What is mean by that.
    I have imported the schema files in project. AFter that I have imported them into the WSDL also. Now why I am getting error while creating the variable. However I can create variable directly in .BPEL file then everything is fine. And it is working also. But what is mean with the above error? Why I am not able to create variable through GUI?
    Thanks.

    Hi,
    I have this same problem this morning, and I was going crazy, until I found this webpage on the internet:
    [http://technology.amis.nl/blog/1803/problem-importing-xml-schema-in-bpel-process|http://technology.amis.nl/blog/1803/problem-importing-xml-schema-in-bpel-process]
    The idea is that the jdeveloper is not very good working with directories with spaces on the directory name. If you move all your work to a directory without spaces, it will work smoothly. At least, it had worked for me.
    Regards,
    Nacho

Maybe you are looking for