cancel
Showing results for 
Search instead for 
Did you mean: 

Error calling WebService

Former Member
0 Kudos

Hi, well it's nearly the first webservice scenario for me, so i have problems

Actually everything works fine at my FM 2 WS Scenario.

But when i try to call http://www.webservicex.net/globalweather.asmx?wsdl with parameters CityName and CountryName i get following error:

soap fault: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Data.SqlClient.SqlException: Procedure or function 'getWeather' expects parameter '@CountryName', which was not supplied. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at WebServicex.GlobalWeather.GetWeather(String CityName, String CountryName) --- End of inner exception stack trace ---

Here i do not under stand the part 'getWeather' expects parameter '@CountryName' because I am giving this parameter even right spelled etc.

Can somebody help?!

br

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

>>getWeather' expects parameter '@CountryName'

You can check few things:

In sxmb_moni,double click on your message(hopefully you don't have any mapping error there),go to call SAP adapter->payload->Main document.this is the payload going to WS,do you see CountryName there?if no,then you neech to check your message mapping.

Secondly check i webservice expects CountryName as an attribute or as an element?it looks like it expects as an attribute and you have defined element for it

Thanks

Aamir

Former Member
0 Kudos

Hi Aamir, first thank you for your response.

Because i found data in SXMB_MONI i thought everything works fine.

But actually there is no data in RWB when calling the webservice.

The SOAP-Document looks like this:

<SOAP:Envelope xmlns:SOAP='http://schemas.xmlsoap.org/soap/envelope/'><SOAP:Header><sap:Main xmlns:sap='http://sap.com/xi/XI/Message/30' versionMajor='3' versionMinor='0' SOAP:mustUnderstand='1'><sap:MessageClass>ApplicationMessage</sap:MessageClass><sap:ProcessingMode>synchronous</sap:ProcessingMode><sap:MessageId>c1787be0-647a-11de-a4b9-000c29ecb4b5</sap:MessageId><sap:TimeSent>2009-06-29T07:02:06Z</sap:TimeSent><sap:Sender><sap:Party agency='http://sap.com/xi/XI' scheme='XIParty'></sap:Party><sap:Service>AIOCLNT150</sap:Service></sap:Sender><sap:Receiver><sap:Party agency='http://sap.com/xi/XI' scheme='XIParty'></sap:Party><sap:Service></sap:Service></sap:Receiver><sap:Interface namespace='urn:sap-com:document:sap:rfc:functions'>Z_WEBSERVICE_GLOBALWEATHER</sap:Interface></sap:Main><sap:DynamicConfiguration xmlns:sap='http://sap.com/xi/XI/Message/30' SOAP:mustUnderstand='1'><sap:Record namespace='http://sap.com/xi/XI/System/RFC' name='ppActivated'>false</sap:Record></sap:DynamicConfiguration><sap:ReliableMessaging xmlns:sap='http://sap.com/xi/XI/Message/30' SOAP:mustUnderstand='1'><sap:QualityOfService>BestEffort</sap:QualityOfService></sap:ReliableMessaging><sap:HopList xmlns:sap='http://sap.com/xi/XI/Message/30' SOAP:mustUnderstand='1'><sap:Hop timeStamp='2009-06-29T07:02:06Z' wasRead='false'><sap:Engine type='AE'>af.c1i.csghhsap07</sap:Engine><sap:Adapter namespace='http://sap.com/xi/XI/System'>XIRA</sap:Adapter><sap:MessageId>c1787be0-647a-11de-a4b9-000c29ecb4b5</sap:MessageId></sap:Hop></sap:HopList><sap:System xmlns:sap='http://sap.com/xi/XI/Message/30' SOAP:mustUnderstand='1'><sap:Record namespace='http://sap.com/xi/XI/Message/30/general' name='senderAgreementGUID'>7ba0791beab33bbeb71e76f8fb2c2300</sap:Record></sap:System></SOAP:Header><SOAP:Body><sap:Manifest xmlns:sap='http://sap.com/xi/XI/Message/30' xmlns:xlink='http://www.w3.org/1999/xlink'><sap:Payload xlink:type='simple' xlink:href='cid:payload-c1a5cd70647a11de8163000c29ecb4b5sap.com'><sap:Name>MainDocument</sap:Name><sap:Description></sap:Description><sap:Type>Application</sap:Type></sap:Payload></sap:Manifest></SOAP:Body></SOAP:Envelope>

I changed the datatype-fields to attribute but also with no success.

Because this webservice seems to be to call it as "document" it's i quite strange to call it right.

Do you have further ideas?!

Best regards

Edited by: Fritz Munster on Jun 29, 2009 9:14 AM

Sorry - no idea why the whole SOAP-Message is not stored properly in this post.

former_member200962
Active Contributor
0 Kudos

Hi,

though the WS expects @CountryName....and one can say that CountryName is an attribute.....if you open the wsdl file from the link given in the first post you dont find CountryName as an attribute....the wsdl itself is using CountryName as an element...

From the WSDL:
<s:element minOccurs="0" maxOccurs="1" name="CityName" type="s:string" /> 
<s:element minOccurs="0" maxOccurs="1" name="CountryName" type="s:string" />

So no need to change the DT element to attribute...

Check if you are using the latest version of the wsdl and no change has been done after that....

I guess you are making a SYnc call from SAP to WS and have a DT, MT, Sync-MI at the SAP end...while the WSDL (as ED), Sync-MI at the Ws-end.....and a proper request-response mapping.....

Regards,

Abhishek.

Former Member
0 Kudos

Hi Abhishek,

you assume right, i have done everything you said concerning DT, MT, MI and of course Mapping.

I wonder why the data from SAP-System reaches SAP PI in SXMB_MONI but when i check in RWB the data is not shown at all. Messages are processed /with error of course) but no data like CityName, CountryName is inside.

Any solutions?

thanks for your help!!

br

former_member200962
Active Contributor
0 Kudos
I wonder why the data from SAP-System reaches SAP PI in SXMB_MONI but when i check in RWB the data is not shown 
at all. Messages are processed /with error of course) but no data like CityName, CountryName is inside

It would mean the followiing:

1) No Data (CountryName, CityName) is passed from SAP system

2) you have not defined a mapping between SAP-data and WSDL.

Are you able to see CountryName and CityName fields (corresponding fields) in the Inbound Message section of SXMB_MONI

Also check what is the message that is passing out of the Request Message Mapping section of SXMB_MONI.....

Unless the processing is successful in IE (i.e. in SXMB_MONI) you wont find anything in RWB.....

Regards,

Abhishek.

Edited by: abhishek salvi on Jun 29, 2009 1:55 PM

Former Member
0 Kudos

Hi,

well i guess i am doing sth wrong.

Especially one thing: do i need a DT, MT and MI for the WSDL message?! I am confused.

Can you tell me what objects i need? I have the wsdl and the function module of SAP imported. What to do in single steps?

I would highly appreciate your help!

br

former_member200962
Active Contributor
0 Kudos
Especially one thing: do i need a DT, MT and MI for the WSDL message?! I am confused.

No need of DT, MT...just include the WSDL file under the Externa Definition tab in IR and then you can use it as MT in MM and in MI....

The function module that you are talking ...is it a RFC?

Regards,

Abhishek.

Former Member
0 Kudos

Hi again,

well that's what i thought but i found a tutorial where the tutor did some extra DT, MT etc.

Now i reconfigured it and well - it's working!

Thanks for your help!!

br Fritz

Answers (0)