Trouble getting soap call right

PatrickTingen

New Member
We are trying to create a call to a webservice. I managed to create a program, based on the documentation from bprowsdldoc. It compiles and runs, but the guys at the receiving end of the WS tell me the request is not valid. The dataset I send is different than what they expect. They sent me an example of how it should look:

Code:
<soapenv:Body>
    <web:CreateOrder soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
      <orderToCreate xsi:type="enc:WebServiceOrder" xmlns:enc="http://agv/WebService.wsdl/encoded">
        <OrderRows xsi:type="enc:ArrayOfWebServiceOrderRow" soapenc:arrayType="enc:WebServiceOrderRow[2]">
          <WebServiceOrderRow>
            <TaskId type="xsi:int">1</TaskId>
            <OperationType type="xsi:int">2</OperationType>
            <Location type="xsi:string">Conveyor1_Pick</Location>
            <Quantity type="xsi:int">0</Quantity>
          </WebServiceOrderRow>

What bothers me is that they have a line with extra attributes (bold red above). How do I get that?

OE11.2 and OE11.7
 
Last edited:

Stefan

Well-Known Member
What does your dataset look like?
It looks like the soapenc namespace declaration is missing.
Googling soapenc pops up: wsimport "Cannot resolve the name..."

soapenc:Array indicates a non-standard style of web service encoding called "RPC Encoding". This is a very old style that used to be popular on Microsoft platforms; it's obsolete (i.e. it's not part of the WS-I spec) and not supported by modern tools like JAX-WS.
 

PatrickTingen

New Member
The dataset definition looks like this:

Code:
DEFINE TEMP-TABLE OrderToCreate NO-UNDO  XML-NODE-NAME "orderToCreate"
    FIELD OrderId         AS CHARACTER XML-NODE-TYPE "ELEMENT".

DEFINE TEMP-TABLE OrderRows NO-UNDO XML-NODE-NAME "OrderRows"
    FIELD Order_recid     AS RECID XML-NODE-TYPE "HIDDEN".

DEFINE TEMP-TABLE OrderItem NO-UNDO XML-NODE-NAME "WebServiceOrderRow"
    FIELD orderRows_recid AS RECID XML-NODE-TYPE "HIDDEN"
    FIELD TaskId          AS INTEGER
    FIELD OperationType   AS INTEGER
    FIELD Location        AS CHARACTER
    FIELD Quantity        AS INTEGER.

DEFINE DATASET orderToCreateDset NAMESPACE-URI "http://agv/WebService.wsdl/encoded"
                                 XML-NODE-NAME 'OrderToCreate' XML-NODE-TYPE "HIDDEN"
    FOR orderToCreate, OrderRows, OrderItem
    PARENT-ID-RELATION rel-1 FOR orderToCreate, OrderRows PARENT-ID-FIELD Order_recid
    PARENT-ID-RELATION rel-2 FOR OrderRows, OrderItem PARENT-ID-FIELD OrderRows_recid.

Should I include an extra ns somewhere?

Currenly I get this XML:
Code:
<?xml version="1.0"?>
<orderToCreate xmlns="http://agv/WebService.wsdl/encoded" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <OrderId xmlns="http://agv/WebService.wsdl/encoded">1</OrderId>
  <OrderRows xmlns="http://agv/WebService.wsdl/encoded">
    <WebServiceOrderRow>
      <TaskId>1</TaskId>
      <OperationType>2</OperationType>
      <Location>DHI.fetch</Location>
      <Quantity>1</Quantity>
    </WebServiceOrderRow>
    <WebServiceOrderRow>
      <TaskId>2</TaskId>
      <OperationType>1</OperationType>
      <Location>DHTA.drop</Location>
      <Quantity>1</Quantity>
    </WebServiceOrderRow>
  </OrderRows>
</orderToCreate>
 

Stefan

Well-Known Member
What's surprising me is that what they expect contains an undeclared namespace'.

You can get quite far with abusively massaging a dataset to give you what you need, in this case you can use:

Code:
DEFINE TEMP-TABLE OrderRows NO-UNDO XML-NODE-NAME "OrderRows"
    FIELD Order_recid     AS RECID XML-NODE-TYPE "HIDDEN"
    field crap        as character serialize-name "soapenc:arrayType" xml-node-type "attribute"
    .

orderRows.crap = 'enc:WebServiceOrderRow[2]'
 
Top