on 08-20-2007 9:03 PM
Hi
I am following this weblog
/people/shabarish.vijayakumar/blog/2006/03/23/rfc--xi--webservice--a-complete-walkthrough-part-1
I have createed RFC as mentioned in this blog
<b>BLOG-----RFC</b>
-
Import :
FROMZIP type CHAR10
TOZIP type CHAR10
Export:
DISTANCE type CHAR10
source code:
FUNCTION Z_WEBSERVICE_TEST_SHABZ.
*"----
""Local interface:
*" IMPORTING
*" VALUE(FROMZIP) TYPE CHAR10
*" VALUE(TOZIP) TYPE CHAR10
*" EXPORTING
*" VALUE(DISTANCE) TYPE CHAR10
*"----
ENDFUNCTION.
-
<b>My RFC</b>
-
Import :
FROMZIP type CHAR10
TOZIP type CHAR10
Export:
DISTANCE type CHAR10
source code:
FUNCTION Zdushanth_webservice.
*"----
""Local interface:
*" IMPORTING
*" <b>REFERENCE</b>(FROMZIP) TYPE CHAR10
*" <b>REFERENCE</b>(TOZIP) TYPE CHAR10
*" EXPORTING
*" <b>REFERENCE</b>(DISTANCE) TYPE CHAR10
*"----
ENDFUNCTION.
when I activate I am getting as Reference parameters are not allowed with RFC ?
I have created by referring this blog but in the source code (Importing and exporting) I am getting REFERENCE ?
why I am getting this ?
Thanks
dushanth
Message was edited by:
dushanth ry
Message was edited by:
dushanth ry
Dushanth,
Change all parameters i.e. import / export / changing in your RFC function module to pass by value. I mean there is a checkbox "Pass value" for every import/export/changing parameter.. Check this checkbox.
RFC always expect values to be pass by values...not by reference.
Nilesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Thanks Jakub and Nilesh for your replies.
I have imported RFC in XI. I have imported .wsdl file also in external definitions but when I click on the WSDL tab, it gives me the following error
"Unable to convert imported document to WSDL
Reason: Error when parsing the XML document (Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XML Declaration not allowed here.(:main:, row:1, col:8))
Check the selected category "
-
<u><b>My wsdl file :</b></u>
<?xml version="1.0" encoding="UTF-8" ?>
- <wsdl:definitions targetNamespace="http://webservices.imacination.com/distance/Distance.jws" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:intf="http://webservices.imacination.com/distance/Distance.jws" xmlns:impl="http://webservices.imacination.com/distance/Distance.jws">
sdl:part name="getLongitudeReturn" type="xsd:double" />
</wsdl:message>
- <wsdl:message name="getLongitudeRequest">
<wdl:part name="zip" type="xsd:string" />
</wsdl:message>
- <wsdl:message name="getLatitudeRequest">
<wsdl:part name="zip" type="xsd:string" />
</wsdl:message>
+ <wsdl:message name="getLatitudeResponse">
<wsdl:part name="getLatitudeReturn" type="xsd:double" />
</wsdl:message>
- <wsdl:message name="getCityResponse">
<wsdl:part name="getCityReturn" type="xsd:string" />
</wsdl:message>
- <wsdl:message name="getCityRequest">
<wsdl:part name="zip" type="xsd:string" />
</wsdl:message>
- <wsdl:message name="getLocationResponse">
<wsdl:part name="getLocationReturn" type="xsd:string" />
</wsdl:message>
- <wsdl:message name="getStateResponse">
<wsdl:part name="getStateReturn" type="xsd:string" />
</wsdl:message>
- <wsdl:message name="getStateRequest">
<wsdl:part name="zip" type="xsd:string" />
</wsdl:message>
- <wsdl:message name="getLocationRequest">
<wsdl:part name="zip" type="xsd:string" />
</wsdl:message>
- <wsdl:message name="getDistanceResponse">
<wsdl:part name="getDistanceReturn" type="xsd:double" />
</wsdl:message>
- <wsdl:message name="getDistanceRequest">
<wsdl:part name="fromZip" type="xsd:string" />
<wsdl:part name="toZip" type="xsd:string" />
</wsdl:message>
- <wsdl:portType name="Distance">
- <wsdl:operation name="getState" parameterOrder="zip">
<wsdl:input name="getStateRequest" message="impl:getStateRequest" />
<wsdl:output name="getStateResponse" message="impl:getStateResponse" />
</wsdl:operation>
- <wsdl:operation name="getLocation" parameterOrder="zip">
<wsdl:input name="getLocationRequest" message="impl:getLocationRequest" />
<wsdl:output name="getLocationResponse" message="impl:getLocationResponse" />
</wsdl:operation>
- <wsdl:operation name="getCity" parameterOrder="zip">
<wsdl:input name="getCityRequest" message="impl:getCityRequest" />
<wsdl:output name="getCityResponse" message="impl:getCityResponse" />
</wsdl:operation>
- <wsdl:operation name="getDistance" parameterOrder="fromZip toZip">
<wsdl:input name="getDistanceRequest" message="impl:getDistanceRequest" />
<wsdl:output name="getDistanceResponse" message="impl:getDistanceResponse" />
</wsdl:operation>
- <wsdl:operation name="getLatitude" parameterOrder="zip">
<wsdl:input name="getLatitudeRequest" message="impl:getLatitudeRequest" />
<wsdl:output name="getLatitudeResponse" message="impl:getLatitudeResponse" />
</wsdl:operation>
- <wsdl:operation name="getLongitude" parameterOrder="zip">
<wsdl:input name="getLongitudeRequest" message="impl:getLongitudeRequest" />
<wsdl:output name="getLongitudeResponse" message="impl:getLongitudeResponse" />
</wsdl:operation>
</wsdl:portType>
- <wsdl:binding name="DistanceSoapBinding" type="impl:Distance">
<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="getState">
<wsdlsoap:operation soapAction="" />
- <wsdl:input name="getStateRequest">
<wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://DefaultNamespace" />
</wsdl:input>
- <wsdl:output name="getStateResponse">
<wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://webservices.imacination.com/distance/Distance.jws" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="getLocation">
<wsdlsoap:operation soapAction="" />
- <wsdl:input name="getLocationRequest">
<wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://DefaultNamespace" />
</wsdl:input>
- <wsdl:output name="getLocationResponse">
<wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://webservices.imacination.com/distance/Distance.jws" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="getCity">
<wsdlsoap:operation soapAction="" />
- <wsdl:input name="getCityRequest">
<wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://DefaultNamespace" />
</wsdl:input>
- <wsdl:output name="getCityResponse">
<wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://webservices.imacination.com/distance/Distance.jws" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="getDistance">
<wsdlsoap:operation soapAction="" />
- <wsdl:input name="getDistanceRequest">
<wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://DefaultNamespace" />
</wsdl:input>
- <wsdl:output name="getDistanceResponse">
<wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://webservices.imacination.com/distance/Distance.jws" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="getLatitude">
<wsdlsoap:operation soapAction="" />
- <wsdl:input name="getLatitudeRequest">
<wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://DefaultNamespace" />
</wsdl:input>
- <wsdl:output name="getLatitudeResponse">
<wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://webservices.imacination.com/distance/Distance.jws" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="getLongitude">
<wsdlsoap:operation soapAction="" />
- <wsdl:input name="getLongitudeRequest">
<wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://DefaultNamespace" />
</wsdl:input>
- <wsdl:output name="getLongitudeResponse">
<wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://webservices.imacination.com/distance/Distance.jws" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
- <wsdl:service name="DistanceService">
- <wsdl:port name="Distance" binding="impl:DistanceSoapBinding">
<wsdlsoap:address location="http://webservices.imacination.com/distance/Distance.jws" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
-
Pls let me know my wsdl is correct or wrong
If not can you pls paste the correct wsdl file here ?
Thanks
dushanth
Here we goo....
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://webservices.imacination.com/distance/Distance.jws" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:intf="http://webservices.imacination.com/distance/Distance.jws" xmlns:impl="http://webservices.imacination.com/distance/Distance.jws">
<wsdl:message name="getLongitudeResponse">
<wsdl:part name="getLongitudeReturn" type="xsd:double"/>
</wsdl:message>
<wsdl:message name="getLongitudeRequest">
<wsdl:part name="zip" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="getLatitudeRequest">
<wsdl:part name="zip" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="getLatitudeResponse">
<wsdl:part name="getLatitudeReturn" type="xsd:double"/>
</wsdl:message>
<wsdl:message name="getCityResponse">
<wsdl:part name="getCityReturn" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="getCityRequest">
<wsdl:part name="zip" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="getLocationResponse">
<wsdl:part name="getLocationReturn" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="getStateResponse">
<wsdl:part name="getStateReturn" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="getStateRequest">
<wsdl:part name="zip" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="getLocationRequest">
<wsdl:part name="zip" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="getDistanceResponse">
<wsdl:part name="getDistanceReturn" type="xsd:double"/>
</wsdl:message>
<wsdl:message name="getDistanceRequest">
<wsdl:part name="fromZip" type="xsd:string"/>
<wsdl:part name="toZip" type="xsd:string"/>
</wsdl:message>
<wsdl:portType name="Distance">
<wsdl:operation name="getState" parameterOrder="zip">
<wsdl:input name="getStateRequest" message="impl:getStateRequest"/>
<wsdl:output name="getStateResponse" message="impl:getStateResponse"/>
</wsdl:operation>
<wsdl:operation name="getLocation" parameterOrder="zip">
<wsdl:input name="getLocationRequest" message="impl:getLocationRequest"/>
<wsdl:output name="getLocationResponse" message="impl:getLocationResponse"/>
</wsdl:operation>
<wsdl:operation name="getCity" parameterOrder="zip">
<wsdl:input name="getCityRequest" message="impl:getCityRequest"/>
<wsdl:output name="getCityResponse" message="impl:getCityResponse"/>
</wsdl:operation>
<wsdl:operation name="getDistance" parameterOrder="fromZip toZip">
<wsdl:input name="getDistanceRequest" message="impl:getDistanceRequest"/>
<wsdl:output name="getDistanceResponse" message="impl:getDistanceResponse"/>
</wsdl:operation>
<wsdl:operation name="getLatitude" parameterOrder="zip">
<wsdl:input name="getLatitudeRequest" message="impl:getLatitudeRequest"/>
<wsdl:output name="getLatitudeResponse" message="impl:getLatitudeResponse"/>
</wsdl:operation>
<wsdl:operation name="getLongitude" parameterOrder="zip">
<wsdl:input name="getLongitudeRequest" message="impl:getLongitudeRequest"/>
<wsdl:output name="getLongitudeResponse" message="impl:getLongitudeResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="DistanceSoapBinding" type="impl:Distance">
<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="getState">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="getStateRequest">
<wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://DefaultNamespace"/>
</wsdl:input>
<wsdl:output name="getStateResponse">
<wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://webservices.imacination.com/distance/Distance.jws"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getLocation">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="getLocationRequest">
<wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://DefaultNamespace"/>
</wsdl:input>
<wsdl:output name="getLocationResponse">
<wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://webservices.imacination.com/distance/Distance.jws"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getCity">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="getCityRequest">
<wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://DefaultNamespace"/>
</wsdl:input>
<wsdl:output name="getCityResponse">
<wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://webservices.imacination.com/distance/Distance.jws"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getDistance">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="getDistanceRequest">
<wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://DefaultNamespace"/>
</wsdl:input>
<wsdl:output name="getDistanceResponse">
<wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://webservices.imacination.com/distance/Distance.jws"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getLatitude">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="getLatitudeRequest">
<wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://DefaultNamespace"/>
</wsdl:input>
<wsdl:output name="getLatitudeResponse">
<wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://webservices.imacination.com/distance/Distance.jws"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getLongitude">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="getLongitudeRequest">
<wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://DefaultNamespace"/>
</wsdl:input>
<wsdl:output name="getLongitudeResponse">
<wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://webservices.imacination.com/distance/Distance.jws"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="DistanceService">
<wsdl:port name="Distance" binding="impl:DistanceSoapBinding">
<wsdlsoap:address location="http://webservices.imacination.com/distance/Distance.jws"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
I have tested this and its working fine...:)
Nilesh
Hi Nilesh,
when I open my distance.wsdl . I am getting the error,
".wsdl is not valid" etc...................
Pls check my screen shot and pls let me know what is this error, how can I solve this. If you need more screen shots I will send you.
http://www.flickr.com/photo_zoom.gne?id=1193672141&size=o
Thanks
dushanth
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.