[Xml-compile] WSDL request and response structure
Bill Moseley
moseley at hank.org
Mon Mar 7 19:58:03 GMT 2011
On Mon, Mar 7, 2011 at 8:28 AM, Robin V. <robinsp at gmail.com> wrote:
> You should look in the list for example of explain call:
>
I guess I should have mentioned that I tried using explain as shown in the
::WSDL11 SYNOPSIS. I didn't see any dump of the expected data structures.
Am I missing a step of some type?
use XML::Compile::WSDL11; # use WSDL version 1.1
use XML::Compile::SOAP11; # use SOAP version 1.1
use XML::Compile::Transport::SOAPHTTP;
my $wsdl =3D XML::Compile::WSDL11->new(
'PersonManagementServiceSyncSingle.wsdl' );
$wsdl->importDefinitions('PersonManagementServiceSyncXSD.xsd' );
warn $wsdl->explain( 'createPerson', PERL =3D> 'INPUT' );
exit;
# Operation createPersonRequest
# INPUT, document literal
# Produced by XML::Compile::SOAP11::Operation version 2.23
# on Mon Mar 7 11:55:06 2011
#
# The output below is only an example: it cannot be used
# without interpretation, although very close to real code.
# Compile only once in your code, usually during initiation:
my $call =3D $wsdl->compileClient('createPerson');
# ... then call it as often as you need.
# To explore the HASHes for each part, use recurse option.
# Part 'Parameters' is element tns:createPersonRequest
my $Parameters =3D {};
# Call with the combination of parts.
my @params =3D (
Parameters =3D> $Parameters,
);
my ($answer, $trace) =3D $call->(@params);
# @params will become %$data_in in the server handler.
# $answer is a HASH, an operation OUTPUT or Fault.
# $trace is an XML::Compile::SOAP::Trace object.
# You may get an error back from the server
if(my $f =3D $answer->{Fault})
{ my $errname =3D $f->{_NAME};
my $error =3D $answer->{$errname};
print "$error->{code}\n";
my $details =3D $error->{detail};
if(not $details)
{ # system error, no $details
}
exit 1;
}
>
>
> > XML is not the problem, but schemas are too verbose to be funny. Have
> > you tried $wsdl->operation(...)->explain
>
>
> Regards,
> Robin
>
> On Mon, Mar 7, 2011 at 4:52 PM, Bill Moseley <moseley at hank.org> wrote:
> > Hi,
> > Mark, and other commiters, thanks so much for XML-Compile-SOAP.
> > I'm working with a standard web services specification and have a number
> of
> > WSDL and associated schema files. I need to implement a server to
> support a
> > small subset of the operations defined in the WSDL files.
> > Frankly, I'm new to WSDL and it's a bit overwhelming trying to look
> through
> > the XML to determine the request and response parameters.
> >
> > http://search.cpan.org/dist/XML-Compile-SOAP/lib/XML/Compile/WSDL11.pod
> says:
> >>
> >> The only complication you have to worry about is to shape a nested HASH
> >> structure to the sending message structure.
> XML::Compile::Schema::template()
> >> may help you.
> >
> > I looked at the docs, and the schema2example script, but have not been
> able
> > to see how to make use of those.
> > Can that method (or the included scripts) be used to detail the structu=
re
> of
> > the request and response?
> > For example, in the portType section of one of my WSDL files (say,
> > person.wsdl) I have this operation:
> > <wsdl11:portType name=3D"PersonManagerSyncPortType">
> > <wsdl11:operation name=3D"createPerson">
> > <wsdl11:input message=3D"tns:createPersonRequest"/>
> > <wsdl11:output message=3D"tns:createPersonResponse"/>
> > </wsdl11:operation>
> > ...
> > </wsdl11:portType>
> > I also have a person.xsd schema file. Will ->template or the included
> > scripts show me the overall structure of those messages and the paramet=
er
> > attributes? Could someone show an example how to accomplish this?
> >
> > Hum, sorry, I'm struggling a bit. Do I also need to look at the bindin=
gs
> to
> > determine additional request and response data? e.g.
> > for HeaderInfoParameters and HeaderInfoResponse?
> > <wsdl11:operation name=3D"createPerson">
> > <soap11:operation
> > soapAction=3D"http://www.imsglobal.org/soap/lis/pms2p0/createPerson"
> > style=3D"document"/>
> > <wsdl11:input>
> > <soap11:body use=3D"literal" parts=3D"Parameters"/>
> > <soap11:header message=3D"tns:createPersonRequest"
> > part=3D"HeaderInfoParameters" use=3D"literal" wsdl11:required=3D"true"/>
> > </wsdl11:input>
> > <wsdl11:output>
> > <soap11:body use=3D"literal" parts=3D"Response"/>
> > <soap11:header message=3D"tns:createPersonResponse"
> > part=3D"HeaderInfoResponse" use=3D"literal" wsdl11:required=3D"true"/>
> > </wsdl11:output>
> > </wsdl11:output>
> > </wsdl11:operation>
> >
> > Thanks,
> > --
> > Bill Moseley
> > moseley at hank.org
> >
> > _______________________________________________
> > Xml-compile mailing list
> > Xml-compile at lists.scsys.co.uk
> > http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/xml-compile
> >
> >
>
-- =
Bill Moseley
moseley at hank.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/xml-compile/attachments/20110307/a9=
96493c/attachment.htm
More information about the Xml-compile
mailing list