function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Mike @ PartnersMike @ Partners 

Question about 'Outbound Message'

Im trying to understand how to use the new 'Outbound Message' feature. Im not very familiar with how this system works. Is there somewhere i can go to read up on how to develop the recving side the the message, or do you have example code of what the receiving side may look like?
Thanks for your help,
Mike

SuperfellSuperfell
There are details in the API docs about the feature which includes .NET 2.0 sample code, there's java sample code on the Wiki, and .NET 1.1. sample code on my blog
Mike @ PartnersMike @ Partners
Thanks
DanSykesDanSykes

Hi i am also trying to use Outbound messages.  I am using .NET 1.1 with VB.I followed the information from the link provided above but i am stuck the missing webservice example, here is what i have in my webservice:

<WebMethod()> _

Public Function notifications(ByVal n As notifications) As notificationsResponse

Dim n1 As NotificationService

Return n1.notifications(n)

End Function

  • I got a soap header error:

Server did not recognize the value of HTTP Header SOAPAction

  • After research i found that this could be because the soap headers namespaces did not match so i had ago at matching them up but i still get the same.
  • Here is my webservice declaration:

<System.Web.Services.WebService(Name:="NotificationBinding", Description:="WebService for the SalesForce Integration", [Namespace]:="http://soap.sforce.com/2005/09/outbound")> _

Public Class SalesForceIntegration

Inherits System.Web.Services.WebService

  • My classes that wsdl.exe created was called NotificationService.vb

<System.Web.Services.WebServiceBindingAttribute(Name:="NotificationBinding", [Namespace]:="http://soap.sforce.com/2005/09/outbound"), _

System.Xml.Serialization.XmlIncludeAttribute(GetType(sObject))> _

Public MustInherit Class NotificationService

Inherits System.Web.Services.WebService

<System.Web.Services.WebMethodAttribute(), _

System.Web.Services.Protocols.SoapDocumentMethodAttribute("", Use:=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Bare)> _

Public Function notifications(<System.Xml.Serialization.XmlElementAttribute("notifications", [Namespace]:="http://soap.sforce.com/2005/09/outbound")> ByVal notifications1 As notifications) As <System.Xml.Serialization.XmlElementAttribute("notificationsResponse", [Namespace]:="http://soap.sforce.com/2005/09/outbound")> notificationsResponse

Dim r As notificationsResponse = New notificationsResponse

r.Ack = True

Return r

End Function

Private objects As ArrayList = New System.Collections.ArrayList

Public Function CurrentO jects() As System.Collections.ArrayList

Return CType(objects.Clone(), ArrayList)

End Function

End Class

Any Help would be very greatfully recieved, Thanks Dan

Scott.MScott.M

Hi all, I am also attempting to understand how the outbound message feature works. I have a couple of questions.

 

- You can set the endpoint for the webservice but how do you select which opperation to execute? 

- Is it possible to call a Salesforce websevice from an outbound message workflow (I'm trying to do this to get around the limitation of no being able to use PageReference.getContent() form inside a trigger or a future method) 

 

Thanks in advance for any help!

 

Scott

SuperfellSuperfell

1. the operation/service definition is predefined by salesforce, the Outbound messaging wsdl defines the message we send.

 

2. no. (you can however have the message goto a server you run, that on receipt makes a webservice call back to your apex code). 

Scott.MScott.M

I can't believe my ears, a salesforce employee suggesting that I run my own server ;). I thought friends didn't let friends buy servers :D. I guess I don't really need a server, I might try wiring something up with google app engine although it seems like an awfull round about way to achieve what I'm trying to do.

 

All I want to do is automatically generate a PDF and attach it to a contract when the contract status is complete. Any ideas how I can accomplish this that's better than a callout out to google app engine which then makes a webservice call back to apex? 

 

Thanks for all your help! 

SuperfellSuperfell
@future is the way to go, are you sure you can't use getContent from a future ? the docs just say you can't use it in a trigger.
Scott.MScott.M

Yeah the following thread says it can't be done

 

http://community.salesforce.com/sforce/board/message?board.id=Visualforce&message.id=8485 

 

I tried and got a null reference error same as the person in this thread. 

 

I've got another workaround though, I'm going put a visualforce page in the layout for contracts that will execute the check and attachement. Not very elegant but it should work :)