2

I've tried the scripts which hugh posted here: PowerShell BizTalk scripts WITHOUT using BizTalk provider for PowerShell

It almost worked perfectly... Except for the Create-BTS-SendHandler-part...

I keep getting a strange error:

Exception calling "Invoke" with "2" argument(s): "Failed during call to one of administration components."
At line:22 char:23
+     $methodInfo.Invoke <<<< ($objSendHandler, $putOptions)
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : DotNetMethodTargetInvocation

$error[0]|Format-List -Force gives this:
System.Management.Automation.MethodInvocationException: Exception calling "Invoke" with "2" argument(s): "Failed during call to one of administration components." ---> System.Runtime.InteropServices.COMExcep                            tion (0xC0C02306): Failed during call to one of administration components.
                           at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
                           at System.Management.ManagementObject.Put(PutOptions options)
                           --- End of inner exception stack trace ---
                           at System.Management.Automation.DotNetAdapter.AuxiliaryMethodInvoke(Object target, Object[] arguments, MethodInformation methodInformation, Object[] originalArguments)
                           at System.Management.Automation.DotNetAdapter.MethodInvokeDotNet(String methodName, Object target, MethodInformation[] methodInformation, Object[] arguments)
                           at System.Management.Automation.DotNetAdapter.MethodInvoke(PSMethod method, Object[] arguments)
                           at System.Management.Automation.Adapter.BaseMethodInvoke(PSMethod method, Object[] arguments)
                           at System.Management.Automation.PSMethod.Invoke(Object[] arguments)
                           at System.Management.Automation.ParserOps.CallMethod(Token token, Object target, String methodName, Object[] paramArray, Boolean callStatic, Object valueToSet)
                           at System.Management.Automation.MethodCallNode.InvokeMethod(Object target, Object[] arguments, Object value)
                           at System.Management.Automation.MethodCallNode.Execute(Array input, Pipe outputPipe, ExecutionContext context)
                           at System.Management.Automation.ParseTreeNode.Execute(Array input, Pipe outputPipe, ArrayList& resultList, ExecutionContext context)
                           at System.Management.Automation.StatementListNode.ExecuteStatement(ParseTreeNode statement, Array input, Pipe outputPipe, ArrayList& resultList, ExecutionContext context)
TargetObject          : 
CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
FullyQualifiedErrorId : DotNetMethodTargetInvocation
ErrorDetails          : 
InvocationInfo        : System.Management.Automation.InvocationInfo
PipelineIterationInfo : {}
PSMessageDetails      : 

I have tried to use both x86 and normal ISE to make sure it is not related to 32-bit. I've also checked that I have the rights to create Send-Handlers.

Any one who has an idea?

/Joakim

Community
  • 1
  • 1
Joakim
  • 55
  • 6
  • I have checked my installation scripts and this works fine for me. What version of .Net do you have? Also are you using PowerShell 2.0? Also, what adapter are you trying to create a hander for? Does it work with a different adapter? – tom redfern Feb 02 '12 at 15:41
  • We are running .NET 3.5 and PowerShell 2.0. I am trying to create Send-Handler for the File-adapter... – Joakim Feb 02 '12 at 15:55
  • Does this work with another adapter? – tom redfern Feb 02 '12 at 16:50
  • 1
    I _finally_ got it to work. I used another adapter (FTP) and a completely new host name. This, together with the fact that I did it all WITHOUT having the BizTalk Administration Console open at the same time did it... But I still had some errors which I can't understand, I will have to investigate them more tomorrow. Oh, and I did try the script in three different environments with the same result! – Joakim Feb 02 '12 at 19:43
  • How bizarre. I have not used this script with the FTP adapter but for me it works fine for the FILE adapter. Well done though! – tom redfern Feb 03 '12 at 10:51
  • Really strange. I will test this with other adapters before I post it as answer! – Joakim Feb 03 '12 at 12:00
  • Now I've done more testing... FTP-adapter works, File and SOAP does not? Really strange! – Joakim Feb 09 '12 at 16:02
  • I would say you should reinstall biztalk. – tom redfern Feb 09 '12 at 16:12
  • Sorry! Now I've tried this on three different BizTalk groups: 2 BizTalk 2009 and 1 BizTalk 2010. Same result! I MUST be doing something totally wrong? But how hard can it be? – Joakim Feb 10 '12 at 13:37
  • How are you calling the adapter names? FILE has to be capitalised I think. – tom redfern Feb 10 '12 at 13:48
  • Hmm, THAT did not cross my mind! I will try it! :D – Joakim Feb 10 '12 at 13:58
  • Dude if that's the reason this is going to be a real face-palm moment! – tom redfern Feb 10 '12 at 14:13
  • did you manage to solve this? – tom redfern Feb 16 '12 at 16:06
  • Yep! Face planted deeply in palm! :S Jeeesus! Well, I hope someone else out there will have some use of this! ;) – Joakim Feb 18 '12 at 18:33

1 Answers1

0

You need to use the proper names for BizTalk adapters, as specified in the

Platform Settings -> Adapters

list in BizTalk administrator. These are case sensitive.

enter image description here

tom redfern
  • 30,562
  • 14
  • 91
  • 126