Hello,

    I have a problem with processing of namespaces in the
servicemix-cxf-bc component. I'm exposing a web service using this
component, and trying to invoke it using apache-axis 1.4 client (i
cant change the stack for the client). I'm getting an error "Namespace
prefix 'xsd' has not been declared" (more details bellow). Axis
declares this namespace in the tag soapenv:Envelope, which is then
removed by the cxf-bc endpoint.
    I had a very similar situation in apache ode. There the
namespaces, especially those, used in the xsi:type attributes only,
were lost in assign and invoke statements. I fixed ode locally, and
added each namespace in the context explicitly by creating
corresponding attributes.
    I can try to fix this issue in the servicemix too, but i want to
ask you if i'm doing something wrong with namespaces, or is it a bug
in the servicemix?

org.apache.cxf.interceptor.LoggingInInterceptor writes the following
xml (irrelevant parts are ommited, and xml if formated to be more
readeable):
    <?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>
          <request xmlns="xxx">
              <maxSubscriptions xsi:type="xsd:long">0</maxSubscriptions>
           </request>
      </soapenv:Body>
    </soapenv:Envelope>

The Normalized message produced by the cxf-bc component is as follows:
    InOut[
      id: ID:10.40.137.92-12a3cbd4a84-13:117
      status: Active
      role: provider
      service: {zzz}www
      endpoint: xslt
      operation: {zzz}qqq
      in: <?xml version="1.0" encoding="UTF-8"?>
        <request xmlns="xxx">
          <maxSubscriptions xsi:type="xsd:long">0</maxSubscriptions>
        </request>
    ]

The further processing fails because of missing declaration of the
prefix "xsd", as it was in the Envelope tag and was removed by the
cxf-bc component. The error looks like this:
    ; Line#: -1; Column#: -1
    net.sf.saxon.trans.XPathException: Namespace prefix 'xsd' has not
been declared
        at 
net.sf.saxon.om.StructuredQName.fromLexicalQName(StructuredQName.java:108)
        at 
net.sf.saxon.functions.ResolveQName.evaluateItem(ResolveQName.java:34)
        at net.sf.saxon.functions.Component.evaluateItem(Component.java:61)
        at 
net.sf.saxon.expr.SingletonComparison.effectiveBooleanValue(SingletonComparison.java:96)
        at net.sf.saxon.instruct.Choose.processLeavingTail(Choose.java:679)
    ....

I'm, using apache-servicemix version 3.3.2 with components version 2010-01.
All hints and suggestions would be very valuable. Excuse me for my poor English.

Karolis Petrauskas

Reply via email to