cancel
Showing results for 
Search instead for 
Did you mean: 

Async Interface being called synchronously via Web service/SOAP

Former Member
0 Kudos

Hi,

I have an asynchronous interface to receive data into XI which is being sent to a file system, I can successfully use this interface to send data to XI using the file sender communication channel, and the monitoring shows the same as asynchronous.

The problem is when i want to use the same setup to send data from a .Net client using SOAP/Web service. This time if I go to monitoring I get to see that the call is synchronous..????... which is quite baffeling...

I am not calling the XI webservice in synchronous mode I am calling the BeginInvoke method thus making an async call.

what is it that I have to do to get the interface to behave as async on being called from a webservice?

Thanks

Aniruddha

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You should be able to call a webservice asynchornously from .net. <b>For an asychronous scenario, Quality of service of sender soap adapter should be set to "Exactly Once".</b>

Check your sender soap adapter!!!

Naveen

Former Member
0 Kudos

hi Naveen,

Thanks for your reply, Do you mean, I need to maintain a sender communication channel as well as a sender agreement for the SOAP Communication, cause right now the communication is happening without the presence of either on of the above.

Does it also imply that the URL proposed by the WSDL designer tool needs to be changed.

I have tried maintaining the sender communication channel and the sender agreement, still the interface is being invoked as synchronous, do I need to generate my WSDL in some different fashion?.

Thanks and Regards,

Aniruddha Gargya

former_member187339
Active Contributor
0 Kudos

Hi Aniruddha,

<i>

>>Do you mean, I need to maintain a sender communication channel as well as a sender agreement for the SOAP Communication, cause right now the communication is happening without the presence of either on of the above.</i>

Thats because it is going through HTTP Adapter (Since it doesn't need Sender Agreement and Sender Communication channel)

<i>>>Does it also imply that the URL proposed by the WSDL designer tool needs to be changed.</i>

yes change it to

http://host:port/XISOAPAdapter/MessageServlet?channel=party:service:channel

Under party:service:channel enter the party name, the service name, and the name of the communication channel.

If no party has been created, enter the following: channel=:service:channel

Refer this link

http://help.sap.com/saphelp_nw04/helpdata/en/fc/5ad93f130f9215e10000000a155106/content.htm

<i>>>I have tried maintaining the sender communication channel and the sender agreement, still the interface is being invoked as synchronous, do I need to generate my WSDL in some different fashion?.</i>

No after doing these changes again recreate your wsdl (initially take proposed url, then change it to the url given above). After that import the wsdl into your application.

And then try your scenario it will work.

Regards

Suraj

Former Member
0 Kudos

hi suraj,

The method you suggested did take me a step ahead and thanks for the help link, it did help...

every thing seems to be in proper shape but this time i am getting a dump on the .Net end saying "Object reference not set to an instance of an object." i am setting the user name and the password in the network credentials, do i need to send then in the SOAP header following is the stack trace of the exception

[NullReferenceException: Object reference not set to an instance of an object.]

System.Web.Services.Protocols.SoapHeaderHandling.SetHeaderMembers(SoapHeaderCollection headers, Object target, SoapHeaderMapping[] mappings, SoapHeaderDirection direction, Boolean client)

System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)

System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)

Thanks and Regards,

Aniruddha

former_member187339
Active Contributor
0 Kudos

Hi Aniruddha,

<i>>>i am setting the user name and the password in the network credentials, do i need to send then in the SOAP header following is the stack trace of the exception</i>

There is no need to send it through SOAP header.

It's not possible to debug the error by just seeing the error message. Can you post your code which calls the XI Server and the corresponding fuctions of wsdl (which are created when you add it to the project) so that I can help you in a better way? But before doing that check whether any of the following tips will be of any help :

<b>Tips :</b>

(1) Have you stepped through the code to find out which value is null? If no, then step through it, you might find some error/null value.

(2)When you create an object of your wsdl function, see whether it is returning Nothing (VB.Net) or null (C#)

(3)Its just because you are using a object whose value or instance is not set.This is a common error but this error is not that difficult to get rid off, you just need to see your declaration part and the assignment of values to any of the control.

Regards

Suraj

Former Member
0 Kudos

Thanks guys. I do understand that this is a old post. However I cannot find the following information. I too have C# Web App call SAP PI BAPI web service getting [NullReferenceException: Object reference not set to an instance of an object.]

Extract of WSDL: In the Request section: How do I initialize these fields:

COMPTEGENERAL

               ITEMS occurs 0 to unbounded.

                         NUMERO_OU_NO_DE_COMPTE String

                         COMPTE_GENERAL String

                         CENTRE_DE_COUTS String

                         MONTANT_DEVISE Decimal

webservicename.COMPTEGENERAL[] = new Mywebservice.Request FromWS[0].ToString();// Does not Work.

                        

              

         

   <xsd:element name="COMPTEGENERAL">

            <xsd:annotation>

              <xsd:appinfo source="http://sap.com/xi/TextID">9ce79547e32411e2a321f4ce4610676a</xsd:appinfo>

            </xsd:annotation>

            <xsd:complexType>

              <xsd:sequence>

                <xsd:element minOccurs="0" maxOccurs="unbounded" name="ITEM">

                  <xsd:annotation>

                    <xsd:appinfo source="http://sap.com/xi/TextID">85ebea01eedf11e2bbe7f4ce4610676a</xsd:appinfo>

                  </xsd:annotation>

                  <xsd:complexType>

                    <xsd:sequence>

                      <xsd:element name="NUMERO_OU_NO_DE_COMPTE" type="xsd:string">

                        <xsd:annotation>

                          <xsd:appinfo source="http://sap.com/xi/TextID">85ebe9faeedf11e29c4bf4ce4610676a</xsd:appinfo>

                        </xsd:annotation>

                      </xsd:element>

                      <xsd:element name="COMPTE_GENERAL" type="xsd:string">

                        <xsd:annotation>

                          <xsd:appinfo source="http://sap.com/xi/TextID">85ebe9fceedf11e28cd7f4ce4610676a</xsd:appinfo>

                        </xsd:annotation>

                      </xsd:element>

                      <xsd:element minOccurs="0" name="CENTRE_DE_COUTS" type="xsd:string">

                        <xsd:annotation>

                          <xsd:appinfo source="http://sap.com/xi/TextID">85ebe9fdeedf11e2b57df4ce4610676a</xsd:appinfo>

                        </xsd:annotation>

                      </xsd:element>

                      <xsd:element name="MONTANT_DEVISE">

                        <xsd:annotation>

                          <xsd:appinfo source="http://sap.com/xi/TextID">85ebea00eedf11e2bdcbf4ce4610676a</xsd:appinfo>

                        </xsd:annotation>

                        <xsd:simpleType>

                          <xsd:restriction base="xsd:decimal">

                            <xsd:totalDigits value="18" />

                            <xsd:fractionDigits value="4" />

                          </xsd:restriction>

                        </xsd:simpleType>

                      </xsd:element>

                    </xsd:sequence>

                  </xsd:complexType>

                </xsd:element>

              </xsd:sequence>

            </xsd:complexType>

          </xsd:element>

        </xsd:sequence>

      </xsd:complexType>

    </xsd:schema>

  </wsdl:types>

Answers (1)

Answers (1)

former_member187339
Active Contributor
0 Kudos

Hi Aniruddha,

Since you are using SOAP adapter for communication, and that too from a .NET you have to specify the interface (at .NET side) as Synchronous. The .NET page will wait for a response from the call made to XI and hence you have to go for Synchronous interface.

Regards

Suraj