2 Replies Latest reply on Sep 23, 2005 9:46 AM by thomas.diesler

    RPC/Literal return value or null

    sonic-dre

      Hi

      I use an RPC/literal WS4EE JBoss EJB Endpoint.
      The Service Methods returns an Bytearray or null.
      And this is a problem, if the method returns an Bytearray everything
      works fine, but if the Service returns null following Remoteexception is
      thrown by my JWSDP 1.6 Client:

      RemoteException: Runtime exception; nested exception is: unexpected null value for literal data
       at com.sun.xml.rpc.client.StreamingSender._handleRuntimeExceptionInSend(StreamingSender.java:318)
       at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:300)
      


      the SOAP Response :

      <?xml version="1.0" encoding="UTF-8"?>
      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
       <soapenv:Body>
       <ns1:myMethodResponse xmlns:ns1="http://myWS.org/method">
       <result xsi:type="xsd:base64Binary" xsi:nil="1"/>
       </ns1:myMethodResponse >
       </soapenv:Body>
      </soapenv:Envelope>
      


      Is there a way that my JAXRPC Client recognize the xsi:nil attribute
      and get a null as return value?

      thx

      dre

        • 1. Re: RPC/Literal return value or null
          sonic-dre


          One soloution for this Problem is to change from rpcliteral to documentliteral and useing the unwrap function from wscompile.

          However I still wonder why a jaxrpc rpcliteral client unexpect null as a possible return value.

          Sorry this Problem is no JBossWS specific,
          but I hope I could help some people with the same problem.

          dre

          • 2. Re: RPC/Literal return value or null
            thomas.diesler

            How is the associated complex type for

            <ns1:myMethodResponse xmlns:ns1="http://myWS.org/method">
            


            defined in schema?

            Does it allow a null value for element result?