cancel
Showing results for 
Search instead for 
Did you mean: 

BLS exposed as Web Service not in rowset/rows format?

Former Member
0 Kudos

Is it possible for the WS response from a BLS to be in another format other then the rowset/row one?

A response in this post suggests it is:

I have created a Transaction output XML property and have defined it as this:


<?xml version="1.0" encoding="UTF-8"?>
<Stockpiles>
  <Mines>
    <Stockpile>
      <CURRENT_TONNES></CURRENT_TONNES>
      <LOCATION_DESC></LOCATION_DESC>
      <LOCATION_TYPE_CODE></LOCATION_TYPE_CODE>
      <PIT_MINE_CODE></PIT_MINE_CODE>
      <BENCH_PIT></BENCH_PIT>
      <BENCH_RL></BENCH_RL>
      <BENCH_MINE_CODE></BENCH_MINE_CODE>
      <PIT_LOCATION_CODE></PIT_LOCATION_CODE>
    </Stockpile>
  </Mines>
</Stockpiles>

However, the WSDL generated never discovers this format:


<s:complexType name="Rowset">
- <s:sequence>
  <s:element maxOccurs="unbounded" minOccurs="0" name="Row" type="s0:Row" /> 
  </s:sequence>
  <s:attribute name="Message" type="s:string" /> 
  </s:complexType>
- <s:complexType name="Row">
  <s:sequence id="RowSequence" /> 
  </s:complexType>
- <s:element name="XacuteResponse">
- <s:complexType>
- <s:sequence>
  <s:element maxOccurs="1" minOccurs="0" name="Rowset" type="s0:Rowset" /> 
  </s:sequence>
  </s:complexType>

I have tried various combinations of removing whitespace, carriage returns, omitting the UTF declaration, to no avail.

If I include a columns definition like this:


<?xml version="1.0" encoding="UTF-8"?>
<Stockpiles>
  <Mines>
    <Columns>
      <Column Description="CURRENT_TONNES" MaxRange="1" MinRange="0" Name="CURRENT_TONNES" SQLDataType="2" SourceColumn="CURRENT_TONNES"/>
      <Column Description="LOCATION_DESC" MaxRange="1" MinRange="0" Name="LOCATION_DESC" SQLDataType="12" SourceColumn="LOCATION_DESC"/>
      <Column Description="LOCATION_TYPE_CODE" MaxRange="1" MinRange="0" Name="LOCATION_TYPE_CODE" SQLDataType="12" SourceColumn="LOCATION_TYPE_CODE"/>
      <Column Description="PIT_MINE_CODE" MaxRange="1" MinRange="0" Name="PIT_MINE_CODE" SQLDataType="12" SourceColumn="PIT_MINE_CODE"/>
      <Column Description="BENCH_PIT" MaxRange="1" MinRange="0" Name="BENCH_PIT" SQLDataType="12" SourceColumn="BENCH_PIT"/>
      <Column Description="BENCH_RL" MaxRange="1" MinRange="0" Name="BENCH_RL" SQLDataType="2" SourceColumn="BENCH_RL"/>
      <Column Description="BENCH_MINE_CODE" MaxRange="1" MinRange="0" Name="BENCH_MINE_CODE" SQLDataType="12" SourceColumn="BENCH_MINE_CODE"/>
      <Column Description="PIT_LOCATION_CODE" MaxRange="1" MinRange="0" Name="PIT_LOCATION_CODE" SQLDataType="12" SourceColumn="PIT_LOCATION_CODE"/>
    </Columns>
    <Stockpile>
      <CURRENT_TONNES></CURRENT_TONNES>
      <LOCATION_DESC></LOCATION_DESC>
      <LOCATION_TYPE_CODE></LOCATION_TYPE_CODE>
      <PIT_MINE_CODE></PIT_MINE_CODE>
      <BENCH_PIT></BENCH_PIT>
      <BENCH_RL></BENCH_RL>
      <BENCH_MINE_CODE></BENCH_MINE_CODE>
      <PIT_LOCATION_CODE></PIT_LOCATION_CODE>
    </Stockpile>
  </Mines>
</Stockpiles>

it works, but the WSDL generated has the rowset/row format.

Has anyone achieved this? If so, could they please post the definition of the XML in the Transaction property and I should be able to work it out for myself.

Cheers.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

No-one? Rick? No thoughts? Ryan, you suggested in the post I linked to that this was possible, can you elaborate please?

Cheers.

Former Member
0 Kudos

Hi, Laurie.

The only format that the built-in WSDLGen supports is the .

However, there are a few options:

1) If the "caller" of the service is flexible, I would not use SOAP Web Services, but instead, I would invoke the Runner servlet directly and get your desired XML stream back as a result as in:

http://<server>/Lighthammer/Runner?Transaction=YourTransaction&OutputParameter=*

2) Alternatively, you can "hand code" some WSDL that would allow you to invoke the Runner servlet indirectly. You'd need to do a few things to make this work:

- Create an XSD schema that corresponds to your XML structure (and any inputs, if you need them), and incorporate this into your WSDL (you can use the WSDL "skeleton" generated by xMII as a starting point)

- Create an example inbound SOAP message that corresponds to your "inputs"

- Create an example outbound SOAP message that corresponds to your "outputs"

- Save/store these two example message(s) as reference documents

- Create a transaction with two parameter, both of type XML, one called "Input" and one called "Output" (the latter being an output, of course)

- Load the two reference documents in your transaction

- Use the assign reference documents menu item to assign these structures to your transaction parameters

- In your transaction, you can link any values you need "from" your Input to support your business logic

- After you have constructed the "payload" for your actual XML data, simply do a "replace XML" link into the ReferenceDocument element that corresponds to the output, then an "assign XML" link from the ReferenceDocument to the transaction output parameter.

Sounds like a lot of work, but once you do it, you'll be able to create new "web services" in just a few minutes.

I've used these techniques to allow xMII to emulate/deliver essentially any SOAP structure in and out. Takes a little effort, but works great! In the end, SOAP is nothing more than an HTTP post of an XML document, receiving an XML document back, and the xMII Runner servlet is capable of handling this scenario.

Feel free to post further questions. If I have time, I'll try to write up a detailed example and step-by-step and post it in the Wiki.

- Rick

Former Member
0 Kudos

Thanks very much Rick for the detailed response.

Cheers.

Answers (0)