RE: How to dynamicly invoke a web service?

Sandip Prashar <[email protected]> Mon, 11 Aug 2008 11:22:47 -0400
Newsgroups gmane.comp.apache.webservices.wsif.user
Message-ID <[email protected]>
--_896e996b-7447-4ff6-b14a-8c03f116b78e_
Content-Type: text/plain; charset="iso-2022-jp"
Content-Transfer-Encoding: 7bit

Are you using Websphere provided WSIF lib, it has some comaptibility issues. Remove the dependency on the WAS WSIF lib and use the external jars from WSIF as per there doc.
 
Thanks,
 
Sandip



Date: Sun, 10 Aug 2008 14:09:22 +0800From: [email protected]: [email protected]: Re:How to dynamicly invoke a web service?
the "No such operation 'request' '' occured when I used the axis provider WSIFDynamicProvider_ApacheAxis(), When I use the soap provider, WSIFDynamicProvider_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="1.0" encoding="UTF-8"?><wsdl:definitions name="WebFeatureService" targetNamespace="http://www.globus.org/namespaces/wfs/core/wfs_instance/service" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:binding="http://www.globus.org/namespaces/wfs/core/wfs_instance/bindings" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">  <wsdl:import namespace="http://www.globus.org/namespaces/wfs/core/wfs_instance/bindings" location="WFS_bindings.wsdl"/>  <wsdl:service name="
 WebFeatureService">    <wsdl:port name="WFSPortTypePort" binding="binding:WFSPortTypeSOAPBinding">      <soap:address location="http://localhost:8080/wsrf/services/"/>    </wsdl:port>  </wsd
 l:service></wsdl:definitions>
 
file 2:<?xml version="1.0" encoding="UTF-8"?><wsdl:definitions name="WebFeatureService" targetNamespace="http://www.globus.org/namespaces/wfs/core/wfs_instance/bindings" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:porttype="http://www.globus.org/namespaces/wfs/core/wfs_instance" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">  <wsdl:import namespace="http://www.globus.org/namespaces/wfs/core/wfs_instance" location="WFS_flattened.wsdl"/>  <wsdl:binding name="WFSPortTypeSOAPBinding" type="porttype:WFSPortType">    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>    <wsdl:operation name="doservice">      <soap:operation soapAction="http://www.globus.org/namespaces/wfs/core/wfs_instance/WFSPortType/doserviceRequest"/>      <wsdl:input>        <soap:
 body use="literal"/>      </wsdl:input>      <wsdl:output>        <soap:body use="literal"/>      </wsdl:output>    </wsdl:operation>  </wsdl:binding></wsdl:definitions>file 3 :<?xml version
 ="1.0" encoding="UTF-8"?><definitions name="WebFeatureService" targetNamespace="http://www.globus.org/namespaces/wfs/core/wfs_instance" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsrpw="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.wsdl" xmlns:wsdlpp="http://www.globus.org/namespaces/2004/10/WSDLPreprocessor" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://www.globus.org/namespaces/wfs/core/wfs_instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsrp="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd">  <types>    <xsd:schema targetNamespace="http://www.globus.org/namespaces/wfs/core/wfs_instance" xmlns:tns="http://www.globus.org/namespaces/wfs/core/wfs_instance" xmlns:xsd="http://www.w3.org/2
 001/XMLSchema">        <!-- REQUESTS AND RESPONSES -->        <xsd:element name="request" type="xsd:string"/>    <xsd:element name="response" type="xsd:string"/></xsd:schema>  </types>  <mes
 sage name="RequestMessage">    <part name="parameters" element="tns:request"/>  </message>  <message name="ResponseMessage">    <part name="parameters" element="tns:response"/>  </message>  <portType name="WFSPortType">    <operation name="doservice">      <input message="tns:RequestMessage"/>      <output message="tns:ResponseMessage"/>    </operation>  </portType></definitions>.If I change the parts of third file to be :<message name="RequestMessage">    <part name="parameters" type="txsd:string"/>  </message>  <message name="ResponseMessage">    <part name="parameters" type="txsd:string"/>  </message>I got a erro: No such operation 'parameters'$B:_(B2008-08-10$B!$(Blorkyo <lorkyo-9Onoh4P/[email protected]> $B<LF;!'(B

Hello, I'm new in using wsif, can anyone give me a example  on how to invoke a webservice? the sample "DynamicInvoker" only support parts as a to be basic type, such as integer, String ansd so on. But if a part refers to a XML element listed below, How should I do? <xsd:element name="request" type="xsd:string"/>    <xsd:element name="response" type="xsd:string"/></xsd:schema>  </types>  <message name="RequestMessage">    <part name="parameters" element="tns:request"/>  </message>  <message name="ResponseMessage">    <part name="parameters" element="tns:response"/>  </message>  <portType name="WFSPortType">    <operation name="doservice">      <input message="tns:RequestMessage"/>      <output message="tns:ResponseMessage"/>    </operation>  </portType></definitions>
 I have tried to pass String object as in put,but get a error :No such operation 'request' .  Do  I need to pass Elements as input parameters? How to generate such Elements and How to set  their values?
 
 
--_896e996b-7447-4ff6-b14a-8c03f116b78e_
Content-Type: text/html; charset="iso-2022-jp"
Content-Transfer-Encoding: 7bit

<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'><BR>Are you using Websphere provided WSIF lib, it has some comaptibility issues. Remove the dependency on the WAS WSIF lib and use the external jars from WSIF as per there doc.<BR>
&nbsp;<BR>
Thanks,<BR>
&nbsp;<BR>
Sandip<BR><BR><BR><BR>

<HR id=EC_stopSpelling>
<BR>
Date: Sun, 10 Aug 2008 14:09:22 +0800<BR>From: lorkyo-9Onoh4P/[email protected]<BR>To: [email protected]<BR>Subject: Re:How to dynamicly invoke a web service?<BR><BR><BR>
<DIV>the "No such operation 'request' '' occured when I used the axis provider WSIFDynamicProvider_ApacheAxis(), When I use the soap provider, WSIFDynamicProvider_ApacheSOAP, it would give a error: No Serializer found to serialize a 'java.lang.String' using encoding style 'literal'.<BR><BR>The whole WSDL is listed as below:<BR>file 1<BR>&lt;?xml version="1.0" encoding="UTF-8"?&gt;<BR>&lt;wsdl:definitions name="WebFeatureService" targetNamespace="http://www.globus.org/namespaces/wfs/core/wfs_instance/service" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:binding="http://www.globus.org/namespaces/wfs/core/wfs_instance/bindings" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"&gt;<BR>&nbsp; &lt;wsdl:import namespace="http://www.globus.org/namespaces/wfs/core/wfs_instance/bindings" loc
 ation="WFS_bindings.wsdl"/&gt;<BR>&nbsp; &lt;wsdl:service name="WebFeatureService"&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;wsdl:port name="WFSPortTypePort" binding="binding:WFSPortTypeSOAPBinding"&gt;
 <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;soap:address location="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="1.0" encoding="UTF-8"?&gt;<BR>&lt;wsdl:definitions name="WebFeatureService" targetNamespace="http://www.globus.org/namespaces/wfs/core/wfs_instance/bindings" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:porttype="http://www.globus.org/namespaces/wfs/core/wfs_instance" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"&gt;<BR>&nbsp; &lt;wsdl:import namespace="http://www.globus.org/namespaces/wfs/core/wfs_instance" location="WFS_flattened.wsdl"/&gt;<BR>&nbsp; &lt;wsdl:binding name="WFSPortTypeSOAPBinding" type="porttype:WFSPortType"&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;wsdl:operation name="doservice"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;so
 ap:operation soapAction="http://www.globus.org/namespaces/wfs/core/wfs_instance/WFSPortType/doserviceRequest"/&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;wsdl:input&gt;<BR>&nbsp;&nbsp;&nbsp;&
 nbsp;&nbsp;&nbsp;&nbsp; &lt;soap:body use="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;&nbsp;&nbsp; &lt;soap:body use="literal"/&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &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="1.0" encoding="UTF-8"?&gt;<BR>&lt;definitions name="WebFeatureService" targetNamespace="http://www.globus.org/namespaces/wfs/core/wfs_instance" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsrpw="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.wsdl" xmlns:wsdlpp="http://www.globus.org/namespaces/2004/10/WSDLPreprocessor"
  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://www.globus.org/namespaces/wfs/core/wfs_instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsrp="http://docs.oasis-o
 pen.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd"&gt;<BR>&nbsp; &lt;types&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;xsd:schema targetNamespace="http://www.globus.org/namespaces/wfs/core/wfs_instance" xmlns:tns="http://www.globus.org/namespaces/wfs/core/wfs_instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;<BR>&nbsp;&nbsp;&nbsp; <BR><BR>&nbsp;&nbsp;&nbsp; &lt;!-- REQUESTS AND RESPONSES --&gt;<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; &lt;xsd:element name="request" type="xsd:string"/&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;xsd:element name="response" type="xsd:string"/&gt;<BR>&lt;/xsd:schema&gt;<BR>&nbsp; &lt;/types&gt;<BR>&nbsp; &lt;message name="RequestMessage"&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;part name="parameters" element="tns:request"/&gt;<BR>&nbsp; &lt;/message&gt;<BR>&nbsp; &lt;mes
 sage name="ResponseMessage"&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;part name="parameters" element="tns:response"/&gt;<BR>&nbsp; &lt;/message&gt;<BR>&nbsp; &lt;portType name="WFSPortType"&gt;<BR>&nbsp
 ;&nbsp;&nbsp; &lt;operation name="doservice"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;input message="tns:RequestMessage"/&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;output message="tns:ResponseMessage"/&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 third file to be :<BR>&lt;message name="RequestMessage"&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;part name="parameters" type="txsd:string"/&gt;<BR>&nbsp; &lt;/message&gt;<BR>&nbsp; &lt;message name="ResponseMessage"&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;part name="parameters" type="txsd:string"/&gt;<BR>&nbsp; &lt;/message&gt;<BR>I got a erro: No such operation 'parameters'<BR><BR>$B:_(B2008-08-10$B!$(Blorkyo &lt;lorkyo-9Onoh4P/[email protected]&gt; $B<LF;!'(B<BR>
<BLOCKQUOTE id=EC_isReplyContent style="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 basic type, such as integer, String ansd so on. But if a part refers to a XML element listed below, How should I do? <BR>&lt;xsd:element name="request" type="xsd:string"/&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;xsd:element name="response" type="xsd:string"/&gt;<BR>&lt;/xsd:schema&gt;<BR>&nbsp; &lt;/types&gt;<BR>&nbsp; &lt;message name="RequestMessage"&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;part name="parameters" element="tns:request"/&gt;<BR>&nbsp; &lt;/message&gt;<BR>&nbsp; &lt;message name="ResponseMessage"&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;part name="parameters" element="tns:response"/&gt;<BR>&nbsp; &lt;/message&gt;<BR>&nbsp; &lt;portType name="WFSPortT
 ype"&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;operation name="doservice"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;input message="tns:RequestMessage"/&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;output m
 essage="tns:ResponseMessage"/&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;/operation&gt;<BR>&nbsp; &lt;/portType&gt;<BR>&lt;/definitions&gt;</DIV>
<DIV>&nbsp;<BR>I have tried to pass String object as in put,but 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></body>
</html>
--_896e996b-7447-4ff6-b14a-8c03f116b78e_--