Showing posts with label Web Services. Show all posts
Showing posts with label Web Services. Show all posts

Saturday, July 07, 2012

Session from SharePoint Saturday–Dayton

SONY DSC

It was a great honor to present my developer talk at the SharePoint Saturday in Dayton

You can find the slides and the demo code in here:  SharePoint Presentation and Demo Code

thanks to all the attendees and their questions.

Wednesday, April 02, 2008

MOCSDG: Mid Ohio Connected System Developer's Group - OSLO

Yeah, the first meeting of this group will be kicked off this Thrusday.!! Don't miss it. If you want to be on the mailing list, email Monish and he will add you to the list. The meeting will be held at the Microsoft Office in Columbus, OH.

This first meeting, is going to be started with a presentation from Delbert Murphy. He is one out of 90 MCA's that holds this certification. He is the only Certified Architect in both Microsoft .NET and Java that I have met. So this is a good opportunity to meet him (even if you DONT believe in Certifications... blog post coming....;)

He will be talking about OSLO, which is not just the next version of BizTalk, but the next generation of a unified platform for integrating applications and services. (lots of buzzwords... ;) This is all part of the Connected Systems Division at Microsoft and I believe these set of technologies that Microsoft is working on will have everything including the kitchen sink!! Elkay Mystic Kitchen sink Don't believe me?

... the technology to deliver these capabilities will be delivered through BizTalk Server "V6", System Center "V5", Visual Studio "V10", BizTalk Services "V1" and .NET Framework "V4". The code name for this effort is "Oslo"...[read whole article]

  1. Visual Studio v.10
  2. System Center v.5
  3. Biztalk Services v.1
  4. .NET framework v4.0
  5. Biztalk Server v.6

and that is very powerful.! And if you are a Challenge Junkie like Brian said, then OSLO will give you something to get excited about.

Wednesday, September 12, 2007

Internal SOAP Processing Failure at Microsoft.BizTalk.WebServices.ServerProxy.Invoke

Searching for that Beautiful code, I have decided to do some refactoring of an existing ODX that gets published as a web service and gets consumed by another .NET application. This ODX was like the diamond on the rock. Except I did not name the schemas correctly to begin with. So I went ahead and change the schema and their types, etc...

Long story short, it executed almost all of the ODX, but it will always fail at the end with the Internal Soap Error. :@

SOAP exception error:
    1 The Web service returned an exception.
    2 System.Reflection.TargetInvocationException: 
    3 Exception has been thrown by the target of an invocation. 
    4 System.Web.Services.Protocols.SoapException: 
    5  Internal SOAP Processing Failure 
    6 at Microsoft.BizTalk.WebServices.ServerProxy.ServerProxy.Invoke(String functionName, Object[] parameters, ParamInfo[] inParamInfos, ParamInfo[] outParamInfos, Int32 bodyPartIndex, String bodyType, ArrayList inHeaders, ArrayList inoutHeaders, ArrayList& inoutHeaderResponses, ArrayList& outHeaderResponses, Type[] outHeaderTypes, String[] outHeaderNamespaces, SoapUnknownHeader[] unknownHeaders, SoapUnknownHeader[]& unknownHeaderResponses, Boolean oneway, Boolean spsSsoEnabled, Object cookie)
    7 at Microsoft.BizTalk.WebServices.ServerProxy.ServerProxy.Invoke(String functionName, Object[] parameters, ParamInfo[] inParamInfos, ParamInfo[] outParamInfos, Int32 bodyPartIndex, String bodyType, ArrayList inHeaders, ArrayList inoutHeaders, ArrayList& inoutHeaderResponses, ArrayList& outHeaderResponses, Type[] outHeaderTypes, String[] outHeaderNamespaces, SoapUnknownHeader[] unknownHeaders, SoapUnknownHeader[]& unknownHeaderResponses, Boolean oneway, Boolean spsSsoEnabled)
    8 at BRE.Application.BRE_Application_EligibilityResolver_SoapEligibilityPort.GetEligibility(CustomerCaseRoot part)
    9 at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
   10 at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   11 at BRE_Application_EligibilityResolver_SoapEligibilityPort.GetEligibility(CustomerCaseRoot CustomerCaseRoot)
   12 
   13 
   14 --- End of inner exception stack trace ---
   15 at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
   16 at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
   17 at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   18 at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   19 at WebServiceStudio.MainForm.InvokeWebMethod()

this error is not the most useful error found. After re-starting all of my process from scratch (delete the application, the bindings, restart the host, restart VStudio), then I still could not find the offending bug.

Usually when I find myself trashing for more than an hour, I try to get some help in the form of "pair-debugging", so I asked my friend Monish to pair with me. After finding out that I had the wrong receive pipelines (PassThru Transmit instead of XML [default behavior when publishing through the wizard]). we got this other error:


    1 A response message sent to adapter "SOAP" 
    2 on receive port "WebPort_EligibilityService/AppEligibilityResolverSoapPort" 
    3 with URI "/EligibilityService/AppEligibilityResolverSoapPort.asmx" 
    4 is suspended. 
    5 Error details: There is an error in XML document (33, 25). 
    6 MessageId:  {3460C12E-A95A-4108-8112-63244EA9D10D}
    7 InstanceID: {C9B8E15C-FF4E-4B36-AFD3-1550B83AE01D}


which seems to point to an XML validation. :D

Now we are getting somewhere.!! On my refactoring of the schemas for BizTalk, I have changed all of the ID's from INT to string, *ALL* of them except one... ;)

Lesson learned: Either get a smart friend named Monish, or be prepare to spend lots of time if you refactor Biztalk schemas.

Wednesday, August 29, 2007

Service Unavailable when deploying an ASMX Service

I deployed an ASMX service to a newly configured machine.
When I open the ASMX, I get the dreaded Service Unavailable error.



looking at the system log, I see this entry:
Event Type: Error
Event Source: DCOM
Event Category: None
Event ID: 10016
Date: 8/29/2007
Time: 8:35:35 AM
User: NT AUTHORITY\NETWORK SERVICE
Computer: CONTOSOQABTS
Description:
The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID
{A9E69610-B80D-11D0-B9B9-00A0C922E750}
to the user NT AUTHORITY\NETWORK SERVICE SID (S-1-5-20). This security permission can be modified using the Component Services administrative tool.

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
all of the IIS settings seems fine. When I set the DefaultAppPool to the administrator account, I get this other error:
Event Type: Warning
Event Source: W3SVC
Event Category: None
Event ID: 1057
Date: 8/29/2007
Time: 9:14:43 AM
User: N/A
Computer: TAMSQABIZTALK
Description:
The identity of application pool 'DefaultAppPool' is invalid, so the World Wide Web Publishing Service can not create a worker process to serve the application pool. Therefore, the application pool has been disabled.

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
Then Dan found this article on MSDN that seems to solve this issue. Basically, you need to add the account that the application pool is running under to the IIS_WPG [IIS Worker Process Group].

Monday, August 13, 2007

How to Publish an ODX on a machine without BTS

Recently I got this question from a client and even thought the answer is no, it is still very confusing when wadding through all of the documentation.

This is the question: Can I deploy/host an orchestration as a web service to a machine that does not have BizTalk Server installed on it?

If you look at the BizTalk documentation, the answer seems a little bit deceiving:


They indicated that there is no Biztalk needed. However, once you keep reading more, it mentioned that you need to have a reverse proxy setup for this setup to work.

Ok, so what if you try deploying the orchestration as a web service, using the Web Services Publishing wizard? Here is the answer:

I took one of the samples from the SDK: C:\Program Files (x86)\Microsoft BizTalk Server 2006\SDK\Samples\Orchestrations\ExposeWebService

I make sure it worked in the localhost. Then I went and published to an Windows 2003 Server that was setup as an application server only [no Biztalk installed]. The web publishing wizard did not report any errors and it completed deploying the service.

Once I tried calling this service, this is what I got:



The error message clearly states: Could not load file or assembly 'microsoft.biztalk.webservices.Serverproxy, .... '. So it is looking for this assembly: Microsoft.BizTalk.WebServices.ServerProxy.dll. This seems obvious that you cannot just copy the missing assembly over to this server without breaking some EULA's ;)

Friday, June 22, 2007

Web Service Studio: GotDotNet vs Codeplex

I have been using this tool for a LONG, LONG time, and everytime I have a hard time trying to find the download for it. So I am putting in here GotDotNet: .Net WebService Studio. Coincidentally, there is another version of this tool on Codeplex. It is called CodePlex: Web Service Studio Express. So I have decided to give it a try and compare it against the old version.

Technically, they are both trying to do the same thing: Help you debug Web Services. For instance, if you have a web service that expects a non-primitive type, you can't use the IIS testing.

This is the Web Service Application I'm going to use to compare both applications:

    1 using System.Web.Services;
    2 
    3 [WebService(Namespace = "http://Blog.Demo.WebServiceStudio.v1")]
    4 [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    5 public class StudioSpyke : WebService
    6 {
    7     public class Customer
    8     {
    9         private string _FirstName;
   10         private string _LastName;
   11         private int _CustID;
   12 
   13         public string FirstName
   14         {
   15             get { return _FirstName; }
   16             set { _FirstName = value; }
   17         }
   18         public string LastName
   19         {
   20             get { return _LastName; }
   21             set { _LastName = value; }
   22         }
   23 
   24         public int CustID
   25         {
   26             get { return _CustID; }
   27             set { _CustID = value; }
   28         }
   29     }
   30     [WebMethod(Description = "Testing Web Studio")]
   31     public string HelloUser(Customer inC)
   32     {
   33         return string.Format("Hello [{0} {1}] your ID is [{2}]..!", inC.FirstName, inC.LastName,inC.CustID );
   34     }
   35 }

if you try debugging this Service, this is what you will get:
The test form is only available for methods with primitive types as parameters


This is where the power of this application comes into play.

GotDotNet Version:
Using the Web Service Studio original version is no sweat.!. You will get the WSDL, and then it figures out the parameters and the type of parameters. It then allows you to enter the values foreach of the Customer object and it will dynamically invoke this method:



Once you hit the Invoke button, it executes the method and returns the result back.





Codeplex Version:
After compiling the source code, I was very dissappointed with the functionality of this tool. The interface seems nice, but it does not do ANYTHING...! Besides invoking the WSDL and give the user a list of methods.



and then the instructions are in Italian (I think...).

In conclusion, stick with the old version for now. :D

Tuesday, March 20, 2007

Guidance Automation Toolkit Installation Failure on Vista

When trying to install the Guidance Automation Toolkit under Vista, you might encounter this error:
The installer has encounter an unexpected error installing this package. This may indicate a problem with this package. The error code is 2869.
This is an RTFM issue. ;) According to the documentation of December 2006, it mentions that this error is because of the UAC (User Account Control) of Vista. They also provide the work around: Run the MSI installer from a VStudio Command prompt that has elevated privileges (Run as Admin).

To install the Service Factory on Windows Vista

1. On the taskbar, click Start, point to All Programs, point to Microsoft Visual Studio 2005, and then click Visual Studio Tools.

2. Right-click Visual Studio 2005 Command Prompt, and then click Run as administrator.

3. Using the Change Directory (cd) command, navigate to the folder where the .msi file is located. For example: C:>cd users\me\downloads.

4. Run msiexec.exe using the following syntax.

msiexec /I "GuidanceAutomationToolkit.msi"

5. Complete the remainder of the installation as described in Installing the Service Factory.



the path to these set of instructions can be found on the CHM file:
Web Services Software Factory - December 2006
----Installing the Service Factory

--------How to: Install the Service Factory on Windows Vista

Wednesday, March 14, 2007

Required Permissions on Web Service Factory

If you get this error, when trying to deploy your ASMX web service factory, it could be because of the trust permission. To fix this problem, open your web.config and anywhere inside the <>,
add the following:
< level ="Full" originurl="">
and it should work.

Server Error in '/XYZServices.Host' Application.
-------------------------------------------------------------------------

Required permissions cannot be acquired.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Security.Policy.PolicyException: Required permissions cannot be acquired.

Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:
[PolicyException: Required permissions cannot be acquired.]
System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Boolean checkExecutionPermission) +2738437
System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Int32& securitySpecialFlags, Boolean checkExecutionPermission) +57

[FileLoadException: Could not load file or assembly 'Microsoft.Practices.ObjectBuilder, Version=1.0.51205.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)]
System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0
System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +211
System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +141
System.Reflection.Assembly.Load(String assemblyString) +25
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +32

[ConfigurationErrorsException: Could not load file or assembly 'Microsoft.Practices.ObjectBuilder, Version=1.0.51205.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +580
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +203
System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +45
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +178
System.Web.Compilation.WebDirectoryBatchCompiler..ctor(VirtualDirectory vdir) +199
System.Web.Compilation.BuildManager.BatchCompileWebDirectoryInternal(VirtualDirectory vdir, Boolean ignoreErrors) +37
System.Web.Compilation.BuildManager.BatchCompileWebDirectory(VirtualDirectory vdir, VirtualPath virtualDir, Boolean ignoreErrors) +445
System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) +77
System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +596
System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +76
System.Web.Compilation.BuildManager.GetVPathBuildResultWithAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +52
System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath) +36
System.Web.UI.WebServiceParser.GetCompiledType(String inputFile, HttpContext context) +44
System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(HttpContext context, String verb, String url, String filePath) +71
System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +328
System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +139
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +146

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210



Sunday, March 11, 2007

How to pre-compile an ASMX web service

Usage:

aspnet_compiler -? to view options. The ones I used are:

-v

Virtual path of app (i.e. “/MyApp”)

-p

Physical directory of the app

-keyfile

Location of strong name key file (snk)

-f

Overwrite previous content

So for example, we have a web service named SoxAuditWss, if we need to move this web service to the QA machine, we could pre-compile it by using the following command:

aspnet_compiler
-v /SoxAuditWss
-p "C:\vsprojects\Services\SOXAuditWSS"
-f "C:\vsprojects\Services\bin"
-keyfile "C:\vsProjects\Services\BTS\yourkeyhere.snk"

Dont forget to add the Key to the compilation step. This is necessary if you are moving this web service to a different machine.