0

I have this problem and I am not sure why it's happening and how to fix it. I have created an OSB peject. In the proxy service pipeline I am doing a Service Callout to a sync SOAP service in another application. The other service needs the request body as below:

  <RequestSelectionValues xmlns="http://www.camstar.com/WebService/WSShopFloor">
            <inputServiceData xmlns:q1="http://www.camstar.com/WebService/DataTypes" q1:type="OnlineQuery">
                <OnlineQuerySetup>
                    <__CDOTypeName/>
                    <__name>xLot By FabLotNumber</__name>
                </OnlineQuerySetup>
                <Parameters>
                    <__listItem>
                        <Name>FabLotNumber</Name>
                        <DefaultValue>FAB_Lot_1</DefaultValue>
                    </__listItem>
                    <__listItem>
                        <Name>BLOCKOF200ROWS</Name>
                        <DefaultValue>1</DefaultValue>
                    </__listItem>
                </Parameters>
            </inputServiceData>
   <queryOption xmlns:q2="http://www.camstar.com/WebService/DataTypes" q2:type="QueryOption">
    <RowSetSize>1000</RowSetSize>
    <StartRow>1</StartRow>
    <QueryType>user</QueryType>
    <ChangeCount>0</ChangeCount>
    <RequestRecordCount>false</RequestRecordCount>
    <RequestRecordSetAndCount>false</RequestRecordSetAndCount>
   </queryOption>
            <serviceInfo xmlns:q3="http://www.camstar.com/WebService/DataTypes" q3:type="OnlineQuery_Info">
                <OnlineQuerySelection>
                    <RequestValue>false</RequestValue>
                    <RequestMetadata>false</RequestMetadata>
                    <RequestSubFieldValues>false</RequestSubFieldValues>
                    <RequestSelectionValues>true</RequestSelectionValues>
                </OnlineQuerySelection>
            </serviceInfo>
  </RequestSelectionValues>

I am using an Assign to put the above expression in a variable.

Notice the line:

<serviceInfo xmlns:q3="http://www.camstar.com/WebService/DataTypes" q3:type="OnlineQuery_Info">

xmlns:q3="http://www.camstar.com/WebService/DataTypes" needs to be before q3:type="OnlineQuery_Info" for the other service to be called successfully otherwise the service call fails.

In the development it looks fine. I can test the assign of expression as well.

When I go to the OSB console to test the service I notice that in the Assign variable the namespace place switches and it becomes like this:

<serviceInfo q3:type="OnlineQuery_Info" xmlns:q3="http://www.camstar.com/WebService/DataTypes">

This makes the service calls to fail. I have tried putting the body payload in an xslt. Result is the same. I am not sure why it switches the type before namespace. The end result is that the service is not working as expected.

Any idea what I can do to fix this issue. How can I prevent the switching?

Thanks

2 Answers 2

0

I haven't found any settings in OSB that can prevent reordering of attributes for you. However, the above OSB behavior is completely XML standard compliant. In fact, the target service side should be XML compliant and treat the two variants mentioned above as the same, because according to XML standard, tow XML documents with only difference in attribute ordering should be treated as the same.

EDIT: Please go here to download a modified config. My thoughts are:

  1. Specify the business service to invoke in 'Text as Request' mode, as "CamstarLotQuery/business/CSWSShopFloor_Txt" shown below: enter image description here
  2. Manipulate messages as text, not XML, in your proxy service, as specified in "CamstarLotQuery/proxy/CamstarLotQueryTxt_Txt":
  3. You might need to specify a SOAP Action in http header when calling a business service, depending on the target service.
9
  • I agree with you but the target service is not accepting the two variants. It's not possible to change anything in that application. It's installed in house but without any customization. The webservices cannot be changed. If it's the normal OSB behavior then I am afraid I am stuck and cannot proceed :(
    – RKS
    Nov 5, 2013 at 17:45
  • I tried using XSLT and outside OSB it works as expected, the attributes are not switched but as soon as I use the same in OSB its switched and service call fails.
    – RKS
    Nov 5, 2013 at 17:46
  • If you work in XML, you are not guaranteed with things like attribute ordering and namespace prefixing. If the target service really works that way, I would suggest you try to work in 'text' mode instead of XML. To be more precise, I think you can try XML as response but text as request, where OSB has no notion of XML when dealing with your request message, hence won't change anything in your request message. Nov 5, 2013 at 22:35
  • If this looks a bit odd for you and your team, you can place this 'odd' logic in a separate proxy/business service to make overall solution look cleaner. What do you think? Nov 5, 2013 at 22:38
  • Hi, it does not work even with text. As soon as I assign the request to a variable it switches the attribute. This issue is really bugging me. I have contacted Oracle support but no resolution so far. I will inform you if I hear something back.
    – RKS
    Nov 8, 2013 at 14:12
0

One solution i can think of is to assign all the namespaces at the Parent Tag Level, and keep the attributes where they are applicable.

Example:

<RequestSelectionValues xmlns:q1="http://www.camstar.com/WebService/DataTypes" xmlns="http://www.camstar.com/WebService/WSShopFloor" xmlns:q2="http://www.camstar.com/WebService/DataTypes" xmlns:q3="http://www.camstar.com/WebService/DataTypes">

But the problem with this implementation is that since the namespace declaration is now Global, you have to declare your namespace prefixes (q1, q2, q3) to the blocks where the namespaces were previously defined.

Example:

<q3:serviceInfo q3:type="OnlineQuery_Info">
   <q3:OnlineQuerySelection>
      <q3:RequestValue>false</q3:RequestValue>
      <q3:RequestMetadata>false</q3:RequestMetadata>
      <q3:RequestSubFieldValues>false</q3:RequestSubFieldValues>
      <q3:RequestSelectionValues>true</q3:RequestSelectionValues>
   </q3:OnlineQuerySelection>
</q3:serviceInfo>

if this namespace prefix is not declared, then as per XML standards, the tag assume the 'default' namespace value - which will be the namespace of the parent.

However, even though this solution has a round-about way of implementation, this solution will definitely work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.