Re:How to dynamicly invoke a web service?

lorkyo <lorkyo-9Onoh4P/[email protected]> Sun, 10 Aug 2008 14:09:22 +0800 (CST)
Newsgroups gmane.comp.apache.webservices.wsif.user
Message-ID <[email protected]>
------=_Part_103631_29088454.1218348562394
Content-Type: text/plain; charset=gbk
Content-Transfer-Encoding: quoted-printable

the "No such operation 'request' '' occured when I used the axis provider W=
SIFDynamicProvider_ApacheAxis(), When I use the soap provider, WSIFDynamicP=
rovider_ApacheSOAP, it would give a error: No Serializer found to serialize=
 a 'java.lang.String' using encoding style 'literal'.

The whole WSDL is listed as below:
file 1
<?xml version=3D"1.0" encoding=3D"UTF-8"?>
<wsdl:definitions name=3D"WebFeatureService" targetNamespace=3D"http://www.=
globus.org/namespaces/wfs/core/wfs_instance/service" xmlns:wsdl=3D"http://s=
chemas.xmlsoap.org/wsdl/" xmlns:binding=3D"http://www.globus.org/namespaces=
/wfs/core/wfs_instance/bindings" xmlns:soap=3D"http://schemas.xmlsoap.org/w=
sdl/soap/">
  <wsdl:import namespace=3D"http://www.globus.org/namespaces/wfs/core/wfs_i=
nstance/bindings" location=3D"WFS_bindings.wsdl"/>
  <wsdl:service name=3D"WebFeatureService">
    <wsdl:port name=3D"WFSPortTypePort" binding=3D"binding:WFSPortTypeSOAPB=
inding">
      <soap:address location=3D"http://localhost:8080/wsrf/services/"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>

=20
file 2:
<?xml version=3D"1.0" encoding=3D"UTF-8"?>
<wsdl:definitions name=3D"WebFeatureService" targetNamespace=3D"http://www.=
globus.org/namespaces/wfs/core/wfs_instance/bindings" xmlns:wsdl=3D"http://=
schemas.xmlsoap.org/wsdl/" xmlns:porttype=3D"http://www.globus.org/namespac=
es/wfs/core/wfs_instance" xmlns:soap=3D"http://schemas.xmlsoap.org/wsdl/soa=
p/">
  <wsdl:import namespace=3D"http://www.globus.org/namespaces/wfs/core/wfs_i=
nstance" location=3D"WFS_flattened.wsdl"/>
  <wsdl:binding name=3D"WFSPortTypeSOAPBinding" type=3D"porttype:WFSPortTyp=
e">
    <soap:binding style=3D"document" transport=3D"http://schemas.xmlsoap.or=
g/soap/http"/>
    <wsdl:operation name=3D"doservice">
      <soap:operation soapAction=3D"http://www.globus.org/namespaces/wfs/co=
re/wfs_instance/WFSPortType/doserviceRequest"/>
      <wsdl:input>
        <soap:body use=3D"literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body use=3D"literal"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
</wsdl:definitions>

file 3 :
<?xml version=3D"1.0" encoding=3D"UTF-8"?>
<definitions name=3D"WebFeatureService" targetNamespace=3D"http://www.globu=
s.org/namespaces/wfs/core/wfs_instance" xmlns=3D"http://schemas.xmlsoap.org=
/wsdl/" xmlns:wsrpw=3D"http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-Reso=
urceProperties-1.2-draft-01.wsdl" xmlns:wsdlpp=3D"http://www.globus.org/nam=
espaces/2004/10/WSDLPreprocessor" xmlns:wsdl=3D"http://schemas.xmlsoap.org/=
wsdl/" xmlns:tns=3D"http://www.globus.org/namespaces/wfs/core/wfs_instance"=
 xmlns:xsd=3D"http://www.w3.org/2001/XMLSchema" xmlns:wsrp=3D"http://docs.o=
asis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd">
  <types>
    <xsd:schema targetNamespace=3D"http://www.globus.org/namespaces/wfs/cor=
e/wfs_instance" xmlns:tns=3D"http://www.globus.org/namespaces/wfs/core/wfs_=
instance" xmlns:xsd=3D"http://www.w3.org/2001/XMLSchema">
   =20

    <!-- REQUESTS AND RESPONSES -->
   =20
    <xsd:element name=3D"request" type=3D"xsd:string"/>
    <xsd:element name=3D"response" type=3D"xsd:string"/>
</xsd:schema>
  </types>
  <message name=3D"RequestMessage">
    <part name=3D"parameters" element=3D"tns:request"/>
  </message>
  <message name=3D"ResponseMessage">
    <part name=3D"parameters" element=3D"tns:response"/>
  </message>
  <portType name=3D"WFSPortType">
    <operation name=3D"doservice">
      <input message=3D"tns:RequestMessage"/>
      <output message=3D"tns:ResponseMessage"/>
    </operation>
  </portType>
</definitions>.

If I change the parts of third file to be :
<message name=3D"RequestMessage">
    <part name=3D"parameters" type=3D"txsd:string"/>
  </message>
  <message name=3D"ResponseMessage">
    <part name=3D"parameters" type=3D"txsd:string"/>
  </message>
I got a erro: No such operation 'parameters'

=D4=DA2008-08-10=A3=AClorkyo <lorkyo-9Onoh4P/[email protected]> =D0=B4=B5=C0=A3=BA

Hello, I'm new in using wsif, can anyone give me a example  on how to invok=
e a webservice? the sample "DynamicInvoker" only support parts as a to be b=
asic type, such as integer, String ansd so on. But if a part refers to a XM=
L element listed below, How should I do?=20
<xsd:element name=3D"request" type=3D"xsd:string"/>
    <xsd:element name=3D"response" type=3D"xsd:string"/>
</xsd:schema>
  </types>
  <message name=3D"RequestMessage">
    <part name=3D"parameters" element=3D"tns:request"/>
  </message>
  <message name=3D"ResponseMessage">
    <part name=3D"parameters" element=3D"tns:response"/>
  </message>
  <portType name=3D"WFSPortType">
    <operation name=3D"doservice">
      <input message=3D"tns:RequestMessage"/>
      <output message=3D"tns:ResponseMessage"/>
    </operation>
  </portType>
</definitions>
=20
I have tried to pass String object as in put,but get a error :No such opera=
tion 'request' .  Do  I need to pass Elements as input parameters? How to g=
enerate such Elements and How to set  their values?

=20

------=_Part_103631_29088454.1218348562394
Content-Type: text/html; charset=gbk
Content-Transfer-Encoding: quoted-printable

<div>the "No such operation 'request' '' occured when I used the axis provi=
der WSIFDynamicProvider_ApacheAxis(), When I use the soap provider, WSIFDyn=
amicProvider_ApacheSOAP, it would give a error: No Serializer found to seri=
alize a 'java.lang.String' using encoding style 'literal'.<br><br>The whole=
 WSDL is listed as below:<br>file 1<br>&lt;?xml version=3D"1.0" encoding=3D=
"UTF-8"?&gt;<br>&lt;wsdl:definitions name=3D"WebFeatureService" targetNames=
pace=3D"http://www.globus.org/namespaces/wfs/core/wfs_instance/service" xml=
ns:wsdl=3D"http://schemas.xmlsoap.org/wsdl/" xmlns:binding=3D"http://www.gl=
obus.org/namespaces/wfs/core/wfs_instance/bindings" xmlns:soap=3D"http://sc=
hemas.xmlsoap.org/wsdl/soap/"&gt;<br>&nbsp; &lt;wsdl:import namespace=3D"ht=
tp://www.globus.org/namespaces/wfs/core/wfs_instance/bindings" location=3D"=
WFS_bindings.wsdl"/&gt;<br>&nbsp; &lt;wsdl:service name=3D"WebFeatureServic=
e"&gt;<br>&nbsp;&nbsp;&nbsp; &lt;wsdl:port name=3D"WFSPortTypePort" binding=
=3D"binding:WFSPortTypeSOAPBinding"&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &=
lt;soap:address location=3D"http://localhost:8080/wsrf/services/"/&gt;<br>&=
nbsp;&nbsp;&nbsp; &lt;/wsdl:port&gt;<br>&nbsp; &lt;/wsdl:service&gt;<br>&lt=
;/wsdl:definitions&gt;<br></div><div>&nbsp;</div><div></div>file 2:<br>&lt;=
?xml version=3D"1.0" encoding=3D"UTF-8"?&gt;<br>&lt;wsdl:definitions name=
=3D"WebFeatureService" targetNamespace=3D"http://www.globus.org/namespaces/=
wfs/core/wfs_instance/bindings" xmlns:wsdl=3D"http://schemas.xmlsoap.org/ws=
dl/" xmlns:porttype=3D"http://www.globus.org/namespaces/wfs/core/wfs_instan=
ce" xmlns:soap=3D"http://schemas.xmlsoap.org/wsdl/soap/"&gt;<br>&nbsp; &lt;=
wsdl:import namespace=3D"http://www.globus.org/namespaces/wfs/core/wfs_inst=
ance" location=3D"WFS_flattened.wsdl"/&gt;<br>&nbsp; &lt;wsdl:binding name=
=3D"WFSPortTypeSOAPBinding" type=3D"porttype:WFSPortType"&gt;<br>&nbsp;&nbs=
p;&nbsp; &lt;soap:binding style=3D"document" transport=3D"http://schemas.xm=
lsoap.org/soap/http"/&gt;<br>&nbsp;&nbsp;&nbsp; &lt;wsdl:operation name=3D"=
doservice"&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;soap:operation soapAct=
ion=3D"http://www.globus.org/namespaces/wfs/core/wfs_instance/WFSPortType/d=
oserviceRequest"/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;wsdl:input&gt;<=
br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;soap:body use=3D"literal"=
/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/wsdl:input&gt;<br>&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp; &lt;wsdl:output&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp; &lt;soap:body use=3D"literal"/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp; &lt;/wsdl:output&gt;<br>&nbsp;&nbsp;&nbsp; &lt;/wsdl:operation&gt;<br>&=
nbsp; &lt;/wsdl:binding&gt;<br>&lt;/wsdl:definitions&gt;<br><br>file 3 :<br=
>&lt;?xml version=3D"1.0" encoding=3D"UTF-8"?&gt;<br>&lt;definitions name=
=3D"WebFeatureService" targetNamespace=3D"http://www.globus.org/namespaces/=
wfs/core/wfs_instance" xmlns=3D"http://schemas.xmlsoap.org/wsdl/" xmlns:wsr=
pw=3D"http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.=
2-draft-01.wsdl" xmlns:wsdlpp=3D"http://www.globus.org/namespaces/2004/10/W=
SDLPreprocessor" xmlns:wsdl=3D"http://schemas.xmlsoap.org/wsdl/" xmlns:tns=
=3D"http://www.globus.org/namespaces/wfs/core/wfs_instance" xmlns:xsd=3D"ht=
tp://www.w3.org/2001/XMLSchema" xmlns:wsrp=3D"http://docs.oasis-open.org/ws=
rf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd"&gt;<br>&nbsp; &lt;t=
ypes&gt;<br>&nbsp;&nbsp;&nbsp; &lt;xsd:schema targetNamespace=3D"http://www=
.globus.org/namespaces/wfs/core/wfs_instance" xmlns:tns=3D"http://www.globu=
s.org/namespaces/wfs/core/wfs_instance" xmlns:xsd=3D"http://www.w3.org/2001=
/XMLSchema"&gt;<br>&nbsp;&nbsp;&nbsp; <br><br>&nbsp;&nbsp;&nbsp; &lt;!-- RE=
QUESTS AND RESPONSES --&gt;<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &l=
t;xsd:element name=3D"request" type=3D"xsd:string"/&gt;<br>&nbsp;&nbsp;&nbs=
p; &lt;xsd:element name=3D"response" type=3D"xsd:string"/&gt;<br>&lt;/xsd:s=
chema&gt;<br>&nbsp; &lt;/types&gt;<br>&nbsp; &lt;message name=3D"RequestMes=
sage"&gt;<br>&nbsp;&nbsp;&nbsp; &lt;part name=3D"parameters" element=3D"tns=
:request"/&gt;<br>&nbsp; &lt;/message&gt;<br>&nbsp; &lt;message name=3D"Res=
ponseMessage"&gt;<br>&nbsp;&nbsp;&nbsp; &lt;part name=3D"parameters" elemen=
t=3D"tns:response"/&gt;<br>&nbsp; &lt;/message&gt;<br>&nbsp; &lt;portType n=
ame=3D"WFSPortType"&gt;<br>&nbsp;&nbsp;&nbsp; &lt;operation name=3D"doservi=
ce"&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;input message=3D"tns:RequestM=
essage"/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;output message=3D"tns:Re=
sponseMessage"/&gt;<br>&nbsp;&nbsp;&nbsp; &lt;/operation&gt;<br>&nbsp; &lt;=
/portType&gt;<br>&lt;/definitions&gt;.<br><br>If I change the parts of thir=
d file to be  :<br>&lt;message name=3D"RequestMessage"&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;part name=3D"parameters" type=3D"txsd:string"/&gt;<b=
r>
&nbsp; &lt;/message&gt;<br>
&nbsp; &lt;message name=3D"ResponseMessage"&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;part name=3D"parameters" type=3D"txsd:string"/&gt;<b=
r>
&nbsp; &lt;/message&gt;<br>I got a erro: No such operation 'parameters'<br>=
<br>=D4=DA2008-08-10=A3=AClorkyo &lt;lorkyo-9Onoh4P/[email protected]&gt; =D0=B4=B5=C0=A3=BA<=
br> <blockquote id=3D"isReplyContent" style=3D"border-left: 1px solid rgb(2=
04, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left: 1ex;"><div>Hello, I=
'm new in using wsif, can anyone give me a example&nbsp; on how to invoke a=
 webservice? the sample "DynamicInvoker" only support parts as a to be basi=
c type, such as integer, String ansd so on. But if a part refers to a XML e=
lement listed below, How should I do?  <br>&lt;xsd:element name=3D"request"=
 type=3D"xsd:string"/&gt;<br>&nbsp;&nbsp;&nbsp; &lt;xsd:element name=3D"res=
ponse" type=3D"xsd:string"/&gt;<br>&lt;/xsd:schema&gt;<br>&nbsp; &lt;/types=
&gt;<br>&nbsp; &lt;message name=3D"RequestMessage"&gt;<br>&nbsp;&nbsp;&nbsp=
; &lt;part name=3D"parameters" element=3D"tns:request"/&gt;<br>&nbsp; &lt;/=
message&gt;<br>&nbsp; &lt;message name=3D"ResponseMessage"&gt;<br>&nbsp;&nb=
sp;&nbsp; &lt;part name=3D"parameters" element=3D"tns:response"/&gt;<br>&nb=
sp; &lt;/message&gt;<br>&nbsp; &lt;portType name=3D"WFSPortType"&gt;<br>&nb=
sp;&nbsp;&nbsp; &lt;operation name=3D"doservice"&gt;<br>&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp; &lt;input message=3D"tns:RequestMessage"/&gt;<br>&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp; &lt;output message=3D"tns:ResponseMessage"/&gt;<br>&nbsp;&=
nbsp;&nbsp; &lt;/operation&gt;<br>&nbsp; &lt;/portType&gt;<br>&lt;/definiti=
ons&gt;</div><div>&nbsp;<br>I have tried to pass String object as in put,bu=
t get a error :No such operation 'request' .&nbsp; Do&nbsp; I need to pass =
Elements as input parameters? How to generate such Elements and How to set&=
nbsp; their values?<br></div><div>&nbsp;</div><div>&nbsp;</div></blockquote=
>
------=_Part_103631_29088454.1218348562394--