cancel
Showing results for 
Search instead for 
Did you mean: 

HTTP GET CALL to B1

Former Member
0 Kudos

Hi, i'm new to B1if, i'm trying to create a scenario like this:

I can make the HTTP Get request, i get the answer, the problem is i want to create directly a Business partner with the get results, the scenario is working with hand made cardcode "test3", my problem i don't know hoe to get the get response returned by atom 1 (HTTP request).

<xsl:template name="transform">

                    <xsl:attribute name="pltype">xml</xsl:attribute>

                      <b1im_multimsg>

                                          <b1im_msg>       

                                                       <B1out xmlns="" type="object">

                                                         <BusinessPartners>

                                                                 <row>

                                                                        <CardCode>test3</CardCode>

                                                                        <CardName></CardName>

                                                                        <Notes></Notes>

                                                                 </row>

        </BusinessPartners>

                                                       </B1out>

                                          </b1im_msg>

                      </b1im_multimsg>

 

          </xsl:template>

Can anybody give a help?

Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

former_member217514
Active Contributor
0 Kudos

This is how I do it

1. Make sure Message Log is on

2. Run Scenario

3. Go to Monitoring -> Message Log

4. Click Display/Refresh

5. Look for your Message in the Log

6. Click the Dbg button

7. There should be 2 transactions types, click Debug button on the top line

8. Scroll to the right.  You are looking for a red atom called vBIU Call.  Click it.  This will open up another window with your Scenario

9. There will be red arrow within each atom.  Click the red arrow on the atom immediately following the http call atom. 

10. Scroll down and find Payload id=atom1.  This will show you what was returned.

You XPath should look something like

/vpf:Msg/vpf:Body/vpf:Payload[./@id='atom1']/<remainder of path to get the information from the http call>

Former Member
0 Kudos

Hi Jeff, thank you for you great help.

My Payload is this:

- <Payload Role="C" id="atom1" statusNo="0" statusMsg="success" reference="atom2" sysid="" payload="atom2" throwException="false">

- <http.header>

   <http.header.info id="X-AspNet-Version" value="4.0.30319" />

   <http.header.info id="X-AspNetMvc-Version" value="3.0" />

   <http.header.info id="Date" value="Tue, 16 Jul 2013 22:16:14 GMT" />

   <http.header.info id="Content-Length" value="620" />

   <http.header.info id="Content-Type" value="text/xml; charset=utf-8" />

   <http.header.info id="Server" value="Microsoft-IIS/7.5" />

   <http.header.info id="X-Powered-By" value="ASP.NET" />

   <http.header.info id="Cache-Control" value="private" />

  </http.header>

- <Agencies xmlns="urn:xxxxxxx:sap:integration">

- <Agency>

   <AgencyGUID>123</AgencyGUID>

   <AgencyName>Test Agency</AgencyName>

   <CountryCode>gb</CountryCode>

   <SAPInstance>gb</SAPInstance>

   <ContactName>Nome de Contacto</ContactName>

   <StreetAddress1>Endereco strada linha 1</StreetAddress1>

   <StreetAddress2>Endereco strada linha 2</StreetAddress2>

   <Suburb>... suburb</Suburb>

   <Postcode>ESTADO codig post</Postcode>

   <Country>pais</Country>

   <ContactPhone>+291 phone</ContactPhone>

   <ContactFax>+291 fax</ContactFax>

   <ModificationDate>2013-07-16T11:11:26.920</ModificationDate>

   </Agency>

  </Agencies>

</Payload>

So my problem is since i'm a newbie I don't know how to get the xPath of the atom a filled here:

<BusinessPartners>

   <row>

        <CardCode>???????</CardCode>

        <CardName>???????</CardName>

    </row>

</BusinessPartners>

Sorry for the dummy questions...

Big thank you!

former_member217514
Active Contributor
0 Kudos

<BusinessPartners>

   <row>

        <CardCode>

               <xsl:value-of select="/vpf:Msg/vpf:Body/vpf:Payload[./@id='atom1']//Agencies/Agency/AgencyGUID" />

        </CardCode>

        <CardName>

               <xsl:value-of select="/vpf:Msg/vpf:Body/vpf:Payload[./@id='atom1']//Agencies/Agency/AgencyName" />

        </CardName>

    </row>

</BusinessPartners>

Former Member
0 Kudos

Hi Jeff... I made a test... I can create the BP... but can't reed the values coming from atom1

<b1im_multimsg>  

  <b1im_msg>       

<B1out xmlns="" type="object">

   <BusinessPartners>

  <row>

    <CardCode>A00021</CardCode>

    <CardName><xsl:value-of select="/vpf:Msg/vpf:Body/vpf:Payload[./@id='atom1']//Agencies/Agency/AgencyName"/></CardName>

  </row>

   </BusinessPartners>

</B1out>

  </b1im_msg>

</b1im_multimsg>

In the log file I can see this:

  <Payload Role="R" id="atom0" pltype="xml">

  <b1im_multimsg xmlns="">

  <b1im_msg>

  <B1out type="object">

  <BusinessPartners>

  <row>

  <CardCode>A00021</CardCode>

  <CardName />

  <Notes />

  </row>

  </BusinessPartners>

  </B1out>

  </b1im_msg>

  </b1im_multimsg>

  </Payload>

former_member217514
Active Contributor
0 Kudos

Try with

/vpf:Msg/vpf:Body/vpf:Payload[./@id='atom1']/Agencies/Agency/AgencyName

Former Member
0 Kudos

I already had tried like you suggest but still not working...

Maybe something have to be with the xml namespace... my HTTP GET return this:

<Agencies xmlns="urn:abc:sap:integration">

<Agency>

  <AgencyGUID>6FDA10C2-AF58-435B-A358-01D75A994E2E</AgencyGUID>

  <AgencyName>Test Agency - Silvio Canha</AgencyName>

  <CountryCode>gb</CountryCode>

  <SAPInstance>gb</SAPInstance>

  <ContactName>Nome de Contacto</ContactName>

  <StreetAddress1>Endereco strada linha 1</StreetAddress1>

  <StreetAddress2>Endereco strada linha 2</StreetAddress2>

  <Suburb>... suburb</Suburb>

  <Postcode>ESTADO codig post</Postcode>

  <Country>pais</Country>

  <ContactPhone>+291 phone</ContactPhone>

  <ContactFax>+291 fax</ContactFax>

  <ModificationDate>2013-07-16T11:11:26.920</ModificationDate>

  </Agency>

</Agencies>

Any idea... ?

Thanks!

former_member217514
Active Contributor
0 Kudos

I was thinking the same thing.  I don't know what namespace the http call belongs to.  The only one I can think of is bfa

Try

/vpf:Msg/vpf:Body/vpf:Payload[./@id='atom1']//bfa:Agencies/bfa:Agency/bfa:AgencyName

Former Member
0 Kudos

not work...

Former Member
0 Kudos

I think something is wrong in HTTP GET call, because if a make an HTTP Get Call to Google I get back the <http.header> + <bfa:io> in the payload... but in my example I only get

<http.header>

</http.header>

<Agencies xmlns="urn:xxxxxxx:sap:integration">

</Agencies>

The <bfa:io> is missing, maybe this is the cause I can't read the atom1 payload in atom 0 like this:

/vpf:Msg/vpf:Body/vpf:Payload[./@id='atom1']//Agencies/Agency/AgencyName

Does anybody has a similar problem whit this... I think the main problem is that my get request return an XML directly and no html surround him...

Thanks for your attention,                                                                  

bastian_schaefer
Active Contributor
0 Kudos
Hi,
you can ignore namespaces with following statement:
/*[local-name()=&apos;namdeofyourxmltag&apos;]
For your example you could try to enter:
<CardName>
     <xsl:value-of select="/vpf:Msg/vpf:Body/vpf:Payload[./@id=&apos;atom1&apos;]/*[local-name()=&apos;Agencies&apos;]/*[local-name()=&apos;Agency&apos;];]/*[local-name()=&apos;AgencyName&apos;]"/>
</CardName>

Best regards

Bastian

Former Member
0 Kudos

Hi Bastian! No words to thank you!

Issue solved!

Former Member
0 Kudos

Hi Bastian, any idea what i'm doing wrong....

<b1im_multimsg> 

<xsl:for-each select="/vpf:Msg/vpf:Body/vpf:Payload[./@id=&apos;atom1&apos;]/*[local-name()=&apos;Agencies&apos;]/*[local-name()=&apos;Agency&apos;]">

   <b1im_msg>       

  <B1out type="object">

    <BusinessPartners>

   <row>

    <CardCode><xsl:value-of select="/*[local-name()=&apos;AgencyName&apos;]"/></CardCode>

   </row>

    </BusinessPartners>

  </B1out>

   </b1im_msg>

  </xsl:for-each>

</b1im_multimsg>

I can't get the CardCode....

Thank you!

bastian_schaefer
Active Contributor
0 Kudos

Hi Silvio,

how does your HTTP-Call Result look if it contains more than one Agency?

Please first check if your for-each loop is working correctly and you're getting more than one Business Partner (with empty CardCode value) created.

If the loop is called correctly, please try a few options for the CardCode tag and check if one of it is working:

addressing the actual AgencyName using "."

<CardCode>

     <xsl:value-of select="./*[local-name()=&apos;AgencyName&apos;]"/>

</CardCode>

Best regards

Bastian

Former Member
0 Kudos

Hi Bastian, it woks! thank you for you help!

Answers (0)