Hm, I would say that the client part of the yaws_soap_lib is a bit broken.

There are a couple of 'call' functions, with increasing number of arguments. The versions with few arguments make a lot of assumptions. In real live these assumptions are almost never true, I would say. There used to be a call/5 that made sense in most cases, but this has been replaced by something that cannot be used in your case.

Fortunately call/6 is still there.

Maybe you can try:
yaws_soap_lib:call("getChassis", "AdcSysInfoSOAP", "AdcSysInfo", [], [{'p:getChassis_datatype', []}], Wsdl).

The tricky thing is to get the 5th argument right. Note that it can be #'p:getChassis_datatype{} (so a record) inside a module, that is the whole idea. If you check the generated .hrl file, you will find the options in the 'choice' in the 'soap:Body' record.

Good luck,
Willem


On Fri, May 16, 2014 at 3:21 PM, Andy Bailey <andy.bailey@rackspace.com> wrote:
On 15/05/14 08:54 +0200, Willem de Jong wrote:
Hi Andy,

Right now I don't have much time to look at this, maybe this weekend.

My advice would be to install soapUI (or a similar tool), and see whether
that accepts the WSDL. If it does, then it is probably OK. If not, then it
will probably tell you what is wrong.

If the WSDL turns out to be OK, then it would help me a lot if you could
provide an example of the error that I can reproduce (a short module or a
couple of statements executed in the shell).

Regards,
Willem

sure thing- the wsdl appears to be valid, so I suspect I'm
misunderstanding how to make requests to functions that don't appear
to require an argument.

I don't have a device I can point you at, but I think since the error
occurs before the request is sent to the api, that shouldn't matter.

Wsdl = yaws_soap_lib:initModel("http://ala.gooseyard.com/~rbailey/sys_service.wsdl").
yaws_soap_lib:call(Wsdl, "getChassis", []).
apologies in advance, it's a pretty big wsdl file!

.andy




On Wed, May 14, 2014 at 4:53 PM, Andy Bailey <andy.bailey@rackspace.com>wrote:

On 13/05/14 20:09 +0200, Willem de Jong wrote:

Hello Andy,

The error message indicates that you are calling the function with a value
that somehow wrong (cannot be translated to an XML document that conforms
to the WSDL). Assuming that you are using yaws_soap_lib:call(), what
values
are you providing?

If you have a recent version of erlsom, you will find a reasonably good
type specification of the value that you should use in the .hrl file that
you get if you use yaws_soap_lib:write_hrl(Wsdl, "service.hrl").

Regards,
Willem


Thanks so much for the response Willem-

When I call initModel and then write the records to a file, it looks
like something is missing.
In the .hrl file, I have a record and type for the response message
for the function I wish to call,
### foo.hrl ###

-record('p:getChassisResponse_datatype', {anyAttribs :: anyAttribs(),
                                        genericInfo ::
                                        'p:ResponseInformation'() |
                                        undefined,
       chassisData :: 'p:chassis'() | undefined}).

-type 'p:getChassisResponse_datatype'() ::
#'p:getChassisResponse_datatype'{}.

-record('p:getChassis_datatype', {anyAttribs :: anyAttribs()}).
-type 'p:getChassis_datatype'() :: #'p:getChassis_datatype'{}.

### end foo.hrl ###

I don't see a record for p:getChassis, which seems odd since the other
working wsdl examples, there'll be a message and an operation with the
same name, and the generated .hrl will have a record and type to
match. Some of my coworkers mentioned having problems with this
vendor's WSDL, so I suspect that the wsdl is the problem, and I'm
hoping someone might spot something obvious. In any case, thanks for
the help!!



Here's an excerpt from the wsdl:

<wsdl:operation name="getChassis">
                                               <wsdl:documentation>Get
chassis information</wsdl:documentation>
                       <wsdl:input message="tns:getChassisRequestMsg"/>

                <wsdl:output message="tns:getChassisResponseMsg"/>
                                                               <wsdl:fault
name="RuntimeFault" message="tns:RuntimeFaultMsg"/>
                                 </wsdl:operation>

<soap:binding style="document" transport="http://schemas.
xmlsoap.org/soap/http" />
<wsdl:operation name="getChassis">
                                                <soap:operation
soapAction="urn:webservicesapi#getChassis" style="document" />
                                 <wsdl:input>

   <soap:header message="tns:getChassisRequestMsg"
part="request_header_part" use = "literal"/>
 <soap:body use="literal" parts="parameters" />
                                            </wsdl:input>

             <wsdl:output>
                                                           <soap:body
use="literal" parts="parameters" />
                                </wsdl:output>

  <wsdl:fault name="RuntimeFault">
                                                <soap:fault
name="RuntimeFault" use="literal" />
                               </wsdl:fault>

 </wsdl:operation>
...

<wsdl:message name="getChassisRequestMsg">
                                                  <wsdl:part
name="parameters" element="tns:getChassis" />

 <wsdl:part name="request_header_part" element="tns:RequestHeader"/>
                                              </wsdl:message>
...
<xsd:element name= "getChassis" type="tns:getChassis_datatype"/>
 <xsd:complexType name= "getChassisResponse_datatype">
<xsd:sequence>
  <xsd:element name="genericInfo" type="tns:ResponseInformation"
minOccurs="0" maxOccurs="1" />
  <xsd:element name="chassisData" type="tns:chassis" minOccurs="0"
maxOccurs="1" />
</xsd:sequence>
</xsd:complexType>
...








On Mon, May 12, 2014 at 11:56 PM, Andy Bailey <andy.bailey@rackspace.com>
wrote:

 yikes! coming to grips with a new mailer, I pasted the body of the
message
after an inadvertent bounce and neglected to paste the subject. Sorry
about that!

 .andy

On 5/12/14, 3:20 PM, "Andy Bailey" <andy.bailey@RACKSPACE.COM> wrote:

>Hi All,
>
>
>
> First of all, my tremendous thanks for yaws! I have only been using
>
> it briefly, but it has been a huge help in a project I've been
>
> working on.
>
>
>
> I've been attempting to use yaws_soap_lib as a client for a soap API
>
> provided by a vendor of networking gear (specifically its a Brocade
>
> ADX load balancer).
>
>
>
> I'm able to retrieve the wsdl for the device via initModel, but when
>
> I try to issue a call for any of the methods in the interfaces, I get
>
> this error:
>
>
>
>** exception throw: {error,"Struct doesn't match model: recordtype not
>
>expected: p:getSystemClock"}
>
>     in function  erlsom_write:findAlternative/4
>
>     (/home/raym7046/projects/fe_lbaas/lib/erlsom/src/erlsom_write.erl,
>
>     line 357)
>
>
>
> It appears that we get to that spot if we're unable to find a value
>
> matching the called function (in this case p:getChassis) in
>
> Alternatives.
>
>
>
> case lists:keysearch(RecordType, #alt.tp, Alternatives) of
>
>
>
> Examining Alternatives, I do see:
>
>
>
>[...,
>
>           {alt,'p:getChassis','p:getChassis_datatype',[],1,1,true,
>
>            undefined},
>
>           {alt,'p:getChassisResponse',
>
>            'p:getChassisResponse_datatype',[],1,1,true,
>
>            undefined},
>
>...],
>
>
>
>although #alt.tp is 3.
>
>
>
>I'm still walking through erlsom_write with my debugger, but I feel
>
>very stumped at the moment, and was wondering if someone knowledgeable
>
>on the list might take a peek at:
>
>
>
>http://ala.gooseyard.com/~rbailey/sys_service.wsdl
>
>
>
>to see if anything is obviously fishy with the wsdl. I have a feeling
>
>that it's a minor issue but I don't understand WSDL and Soap well
>
>enough understand what I'm looking at.
>
>
>
> Thanks in advance!
>
>
>
> .andy
>-----------------------------------------------------------
---------------
>----
>"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
>Instantly run your Selenium tests across 300+ browser/OS combos.
>Get unparalleled scalability from the best Selenium testing platform
>available
>Simple to use. Nothing to install. Get started now for free."
>http://p.sf.net/sfu/SauceLabs
>_______________________________________________
>Erlyaws-list mailing list
>Erlyaws-list@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/erlyaws-list



------------------------------------------------------------
------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform
available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/erlyaws-list