2 Replies Latest reply on Feb 14, 2007 3:20 AM by Martin Steinle

    XMLStreamException in client.JaxRPCHeaderContextProcessor

    Martin Steinle Newbie

      Hello,

      once again, I tried to call a Java web service from a WCF client. My java web service calls a WCF web service in turn, and the complete scenario is secured by a WS-AtomicTransaction. The service.JaxRPCHeaderContextProcessor of the java web service manages to deserialize the ws-coordination header (at least there are no exceptions), but when the client.JaxRPCHeaderContextProcessor tries to serialise the ws-coordination header there is the following exception:

      17:36:08,821 WARN [wstxLoggerI18N] [com.arjuna.mw.wst.client.JaxRPCHCP_1] - Error in:
      17:36:08,821 WARN [wstxLoggerI18N] [com.arjuna.mw.wst.client.JacRPCHCP_2] - Stack trace:
      17:36:08,821 ERROR [STDERR] javax.xml.stream.XMLStreamException
      17:36:08,821 ERROR [STDERR] at com.arjuna.webservices.adapters.SAAJXMLStreamWriter.writeNamespace(SAAJXMLStreamWriter.java:276)
      17:36:08,930 ERROR [STDERR] at com.arjuna.webservices.adapters.SAAJXMLStreamWriter.writeDefaultNamespace(SAAJXMLStreamWriter.java:287)
      17:36:08,930 ERROR [STDERR] at com.arjuna.webservices.stax.AnyElement.writeChildContent(AnyElement.java:98)
      17:36:08,930 ERROR [STDERR] at com.arjuna.webservices.stax.ElementContent.writeContent(ElementContent.java:41)
      17:36:08,930 ERROR [STDERR] at com.arjuna.webservices.stax.AnyContentAnyAttributeSupport.writeChildContent(AnyContentAnyAttributeSupport.java:164)
      17:36:08,930 ERROR [STDERR] at com.arjuna.webservices.wscoor.CoordinationContextType.writeChildContent(CoordinationContextType.java:194)
      17:36:08,930 ERROR [STDERR] at com.arjuna.webservices.stax.ElementContent.writeContent(ElementContent.java:41)
      17:36:08,930 ERROR [STDERR] at com.arjuna.mw.wst.common.CoordinationContextHelper.serialise(CoordinationContextHelper.java:54)
      17:36:08,930 ERROR [STDERR] at com.arjuna.mw.wst.client.JaxRPCHeaderContextProcessor.handleRequest(JaxRPCHeaderContextProcessor.java:175)
      17:36:08,930 ERROR [STDERR] at org.jboss.webservice.handler.HandlerWrapper.handleRequest(HandlerWrapper.java:121)
      17:36:08,930 ERROR [STDERR] at org.jboss.webservice.handler.HandlerChainBaseImpl.handleRequest(HandlerChainBaseImpl.java:231)
      17:36:08,946 ERROR [STDERR] at org.jboss.webservice.client.ClientEngine.invoke(ClientEngine.java:125)
      [...]

      Debugging into the code, I found out that the root cuase is a NullPointerException because in SAAJXMLStreamWriter.writeNamespace() the prefix for namespace "http://schemas.xmlsoap.org/ws/2004/10/wscoor" is null.

      Perhaps the reason is that microsoft uses no prefix when declaring this namespace. This is the header of the SOAP message sent by the WCF client to my java web service:
      <s:Header>
       <ActivityId CorrelationId="6dd30adc-5dec-4a9e-b0e8-b3b0f1e44697"
       xmlns="http://schemas.microsoft.com/2004/09/ServiceModel/Diagnostics">
       30ac0db2-6e3f-4fc2-9378-2796e36a5a7e
       </ActivityId>
       <CoordinationContext s:mustUnderstand="1"
       xmlns="http://schemas.xmlsoap.org/ws/2004/10/wscoor"
       xmlns:mstx="http://schemas.microsoft.com/ws/2006/02/transactions">
       <wscoor:Identifier
       xmlns:wscoor="http://schemas.xmlsoap.org/ws/2004/10/wscoor">
       urn:uuid:dd65d501-5a73-48c7-bc89-444ba8ba512b
       </wscoor:Identifier>
       <Expires>17408</Expires>
       <CoordinationType>
       http://schemas.xmlsoap.org/ws/2004/10/wsat
       </CoordinationType>
       <RegistrationService>
       <Address
       xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing">
       https://node3058.it.de:10443/WsatService/Registration/Coordinator/
       </Address>
       <ReferenceParameters
       xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing">
       <mstx:RegisterInfo>
       <mstx:LocalTransactionId>
       dd65d501-5a73-48c7-bc89-444ba8ba512b
       </mstx:LocalTransactionId>
       </mstx:RegisterInfo>
       </ReferenceParameters>
       </RegistrationService>
       <mstx:IsolationLevel>0</mstx:IsolationLevel>
       <mstx:LocalTransactionId>
       dd65d501-5a73-48c7-bc89-444ba8ba512b
       </mstx:LocalTransactionId>
       <PropagationToken
       xmlns="http://schemas.microsoft.com/ws/2006/02/tx/oletx">
       AQAAAAMAAAAB1WXdc1rHSLyJREuoulErAAAQAAAAAAB8AAAAAP///4LS6HlX0uh5clisZ9oT8nlyWKxnYO0SAKS01gAIaxgApOwSAGM4MzhiNTcxLTc0YjgtNDAxOC05MmEwLThkYTBhMmVkYmJhZAAANwAIAAAAZM1kzSEAAABOT0RFMzA1OAAAMAAUAAAATgBPAEQARQAzADAANQA4AAAAcgABAAAAAAAAABUAAAB0aXA6Ly9Ob2RlMzA1OC5pdC5kZS8AYQA=
       </PropagationToken>
       </CoordinationContext>
       </s:Header>
      


      Though this exception is thrown, a SOAP message is sent from the java web service to the WCF web service, but the WS-Coordination context is not serialized completely and therefore the WCF service does not understand it. For completeness, here the WS-Coordination header of the SOAP message sent from Java to WCF (IMO it should look like the header above):
      <wscoor:CoordinationContext s:mustUnderstand="1" xmlns:wscoor="http://schemas.xmlsoap.org/ws/2004/10/wscoor" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
       <wscoor:Identifier xmlns:wscoor="http://schemas.xmlsoap.org/ws/2004/10/wscoor">urn:uuid:0113c2dc-c084-4469-b5c0-67b5cd24b182</wscoor:Identifier>
       <wscoor:Expires xmlns:wscoor="http://schemas.xmlsoap.org/ws/2004/10/wscoor">55808</wscoor:Expires>
       <wscoor:CoordinationType xmlns:wscoor="http://schemas.xmlsoap.org/ws/2004/10/wscoor">http://schemas.xmlsoap.org/ws/2004/10/wsat</wscoor:CoordinationType>
       <wscoor:RegistrationService xmlns:wscoor="http://schemas.xmlsoap.org/ws/2004/10/wscoor">
       <wsa:Address xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">https://node3058.it.de:10443/WsatService/Registration/Coordinator/</wsa:Address>
       <wsa:ReferenceParameters xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
       <mstx:RegisterInfo xmlns:mstx="http://schemas.microsoft.com/ws/2006/02/transactions">
       <mstx:LocalTransactionId xmlns:mstx="http://schemas.microsoft.com/ws/2006/02/transactions">0113c2dc-c084-4469-b5c0-67b5cd24b182</mstx:LocalTransactionId>
       </mstx:RegisterInfo>
       </wsa:ReferenceParameters>
       </wscoor:RegistrationService>
       <mstx:IsolationLevel xmlns:mstx="http://schemas.microsoft.com/ws/2006/02/transactions"/>
      </wscoor:CoordinationContext>


      Could this be a JBossTS issue?
      I would be very happy about any help.
      Regards, Martin