0
votes

Please help me on this error.I have a soap client calling the service with 3 operation. So in flow1 i'm setting the session varaible to store the operation. And in flow2 i have used set property to accessing those variables to come as outbound message Property before the cxf:jaxws-client. As descripted in this link: mule dynamically setting soap operation but i'm getting exception like "local part cannot be "null" when creating a QName".

I have monitored by keeping logger after set property. Can able to see the operation with values in outbound message property. Not sure why the value is not placed in soap operation field.Please find my xml config.

         <flow name="Flow1" doc:name="eFlow" tracking:enable-default-events="false">
          <wmq:inbound-endpoint queue="InputQ"  connector ref="WMQ_Connector" doc:name="connector">
           <wmq:transaction action="NONE"/>
          </wmq:inbound-endpoint>
           <set-session-variable variableName="cxf_operation"
        value="#[xpath('fn:local-name(/root/*[2])')]" doc:name="Set_Operation" />
          <some logic here.../>
        </flow>

        <flow name="Service_call" doc:name="Service">
        <set-property propertyName="operation" value="#[sessionVars.cxf_operation]"
        doc:name="Property" />
        <logger message="***outbound properties: #[message.outboundProperties]***" level="INFO" doc:name="Logger"/>
 <cxf:jaxws-client  enableMuleSoapHeaders="true" doc:name="SOAP" serviceClass="com.valid.ICase"/>
   <http:outbound-endpoint exchange-pattern="request-response"
                method="POST" doc:name="HTTP"         address="http://localhost:8085/callingService" />
  <some logic here.../>
   </flow>

I havn't set soap operation since i have set property. Still i'm getting error. Can anyone help on this. But when i manually type the operation name. Able to see the response.

3
Can you show your payload?Charu Khurana

3 Answers

0
votes

The attribute operation of the CXF jaxws-client is taken when it is inside the cxf:jaxws-client element tag. So you can declare the operation in the cxf:jaxws-client tag.

Second thing is the operation attribute in the cxf:jaxws-client cannot evaluate Mule Expression Language. So it cannot take MEL expressions. It can take only String. That is the reason it is working when you type it manually and not loading dynamically.

Check Mule Jira if there is any such issue reported.

Mule Jira

0
votes

I'm getting exception like "local part cannot be "null" when creating a QName"

The operation property you're setting should be a javax.xml.namespace.QName. So you need to extract the namespace URI and local part from sessionVars.cxf_operation and use this QName constructor in the set-property before the cxf:jaxws-client.

This assumes that sessionVars.cxf_operation is of the form {namespaceURI}localPart. If that is not the case, and it actually only contains the localPart then you'll have to hard code the namespace URI in the QName constructor, using the hopefully unique namespace into which all the operations are defined.

0
votes

Just use it before cxf:jaxws-client

<set-variable value="#[message.inboundProperties['operation']]" variableName="operation" />