接收来自eBay​​ API SOAP通知到ASP变量? [英] Receiving SOAP notifications from eBay api into ASP variable?

查看:407
本文介绍了接收来自eBay​​ API SOAP通知到ASP变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图接受易趣的API交易通知到ASP托管的Web服务器上。通知作为SOAP消息发送,并且可以发送到查询字符串的URL。通知必须回应与HTTP 200 OK。我想通知给一个变量里面的土地,这样我可以解析它,并将其发送到系统的一个部分。

I am trying to receive ebay api transaction notifications into an ASP hosted on a web server. The notifications are sent as SOAP messages and can be sent to a URL with a query string. Notifications must be responded to with HTTP 200 OK. I would like the notification to land inside a variable so that I can parse it and send it on to the next part of the system.

<一个href=\"http://developer.ebay.com/DevZone/guides/ebayfeatures/Notifications/Notifications.html#ReceivingPlatformNotifications\" rel=\"nofollow\">http://developer.ebay.com/DevZone/guides/ebayfeatures/Notifications/Notifications.html#ReceivingPlatformNotifications

在文档他们提到这是可能的,但他们给出的样本去订阅电子邮件服务器的路由。此ASP就不一定需要进行SOAP请求,从eBay的服务器只是接受SOAP消息。

In the documentation they mention that this is possible, but the sample they give goes the route of subscribing to an email server. This ASP would not necessarily need to make SOAP requests, just accept SOAP messages from the ebay servers.

我学习ASP,SOAP和查询字符串,但一些指导将是真正的AP preciated。谢谢!

I am studying ASP, SOAP, and query strings, but a little guidance would be truly appreciated. Thanks!

推荐答案

这应该是pretty直线前进,你的传统的ASP页面将成为eBay的通知API端点的(只要你已经配置发送通知,什么URL来送他们)

This should be pretty straight forward, your Classic ASP page becomes the endpoint for the eBay Notification API (as long as you have configured it to send notifications and what URL to send them to).

您应该可以用一个简单的经典ASP页面来测试这种

You should be able to test this with a simple Classic ASP page

<%
Dim isPost: isPost = (UCase(Request.ServerVariables("REQUEST_METHOD") & "") = "POST")
Dim hasSoapAction

'Is it a HTTP POST?
If isPost Then
  'Do we have a SOAPACTION header (check both because 
  'it can be either HTTP_ or HEADER_ depending on IIS version)?
  hasSoapAction = ( _
    Len(Request.ServerVariables("HEADER_SOAPACTION") & "") > 0 Or _
    Len(Request.ServerVariables("HTTP_SOAPACTION") & "") > 0 _
  )
  If hasSoapAction Then
    'Process the notification here.
    'Use Request.BinaryRead to read the SOAP
  End If
  'Let eBay know we have received and processing the message.
  Response.Status = "200 OK"
Else
  'Return method not allowed
  Response.Status = "405 Method Not Allowed"
End If
Response.End
%>

您可能还需要检查 REMOTE_HOST ,以确保您只得到发送的邮件的预期源的(这虽然不是防弹的信息可以欺骗

You might also want to check REMOTE_HOST to make sure that you are only getting sent messages for the expected source (this isn't bulletproof though as the information can be spoofed).


  • 访问请求的身体(大现有答案解释如何使用 Request.BinaryRead()阅读的内容,并将其转换为字符串,然后您可以在一个变量或与 XMLDocument.LoadXML解析())。

  • Accessing a request's body (great existing answer that explains how to use Request.BinaryRead() to read the content and convert it to a string which you can then use in a variable or for parsing with XMLDocument.LoadXML()).

如何在传统的ASP使用VBScript来生成MD5?(如果你想看看验证MD5签名的方式)

这篇关于接收来自eBay​​ API SOAP通知到ASP变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆