Can ASP.NET Web API methods be called from a Windows CE app / CF 3.5? - rest

We were thinking about doing something like WCF / REST - I think the techn[ique,ology] was called ADO.NET Data Services in VS 2008 / .NET 3.5 - anyway, something like a RESTful receiving and transmitting of data from a CF 3.5 app and a desktop .NET 4 app to simplify the client / Windows CE app so that it simply sends and receives XML or JSON data, rather than connecting to a remote database or so.
However, according to Where to start REST web service in C# or ASP.Net:
"REST in WCF no longer supported - now it points to ASP"
From the same link:
"ASP.NET Web API is now the Microsoft framework for creating RESTful services.
http://www.asp.net/web-api"
Okay, I think we can do that (WebAPI) - the plan is to host the server/service in IIS; however: Can ASP.NET Web API methods be called from CF 3.5? Does anybody have examples of such?

As long as CF 3.5 can make http requests, then you should be able to make rest calls. Look for HttpWebRequest in CF.
http://msdn.microsoft.com/en-us/library/aa446517.aspx

Look at Microsoft's article Calling WCF Services.
To create your service, you are going to need to Power Toys for .NET Compact Framework 3.5, then turn around after installing that to Download the New NetCFSvcUtil (that is a direct download).
I've created Batch files that I store in my Services folder of my Windows Mobile Project (that way, I can't lose them). The batch file is like this:
** create.bat **
NetCFSvcUtil.exe /l:cs /o:Employee.cs /cb:ServiceModelBase http://cpweb2/mainframe/AcpEmployee.svc?wsdl
pause
NetCFSvcUtil.exe /l:cs /o:Packout.cs /cb:ServiceModelBase http://cpweb2/mainframe/AcpPackout.svc?wsdl
pause
That creates 2 Proxy files for me: One for Employees and one for my Packout service. They both create the same base file, ServiceModelBase, which is just a way for services to throw exceptions.
Adding the pause between steps enables you to read any error messages that are thrown up on the screen before running the next command.

Related

FabricInvalidAddressException: NamedEndpoint 'V2Listener' when trying to connect from .NET Core application

I'm am trying to connect to a Service Fabric application using the ServiceProxy class like so:
return ServiceProxy.Create<ISomeService>(
new Uri("fabric:/SomeService.App/ISomeService"),
new ServicePartitionKey(0));
When I do this from a .Net Framework application everything works fine.
However, when I try this from a .Net Core application I get the following error:
InnerException = {System.Fabric.FabricInvalidAddressException: NamedEndpoint 'V2Listener' not found in the address '{"Endpoints":{"":"..."}}' for partition '...')
I'm assuming this has something to do with V2 remoting, but I can't figure out what exactly it is in the .Net Core project that is defaulting it to use V2 instead of V1.
Is there a way I can force it to use V1 - I'm not in a position to upgrade the target service to V2 at the moment.
All applications involved are using Service Fabric version 6.1.480
Only relevant documentation I can find is Service Fabric Reliable Services Communication Remoting and it hasn't helped me find a solution.
You can only use SF Remoting V2 in .Net Core.
Remoting V1 is supported using Full Framework only. (I agree that the documentation should specify this.)
See this link

jbpm 6.0.1 create process calling rest

How to create process with 1 service task - rest which calls
http://www.webservicex.net/currencyconvertor.asmx/ConversionRate?FromCurrency=EUR&ToCurrency=USD
and sets this value as parameter which can be seen later, using jbpm console(kie workbench)? JBOSS docs are mostly for user tasks.
My recommended solution is to create a new WorkItemHandler implementation that calls the web service get the results and inject that as a process variable.
You can see a similar example that calls web services here: https://github.com/droolsjbpm/jbpm-playground/tree/master/customer-relationships-workitems
HTH
There is a REST service task that you can use, available out-of-the-box in the web-based designer (under service tasks, so implemented as a custom service task). The associated handler should also be registered automatically when using the jbpm-installer:
https://github.com/droolsjbpm/jbpm/blob/master/jbpm-installer/conf/META-INF/CustomWorkItemHandlers.conf#L4

How to create HelloWorld Zend Soap Server & Client over SSL using Self Signed Certificate

I am trying to create a basic SOAP Server over SSL. Before making Web Services available on my Production website, I have to test it on Development system with has got Self Signed Certificate (Whose authentication is a problem right now). Following are the problems I am facing in that regard:
When I try to call https://zendsoap.lan/Zend_Soap_server.php?wsdl
its works fine I can view the wsdl.
But when I try https://zendsoap.lan/Zend_Soap_server.php, I get
this:
SOAP-ERROR: Parsing WSDL: Couldn't load from
'https://zendsoap.lan/Zend_Soap_Server.php?wsdl' : failed to load
external entity "https://zendsoap.lan/Zend_Soap_Server.php?wsdl"
Is that something I should be getting or Some nice looking HTML page
describing the usage of webservice like in NuSoap.
I tried verify_peer=>false as I am running it on dev server so no need to verify my own created certificate, but obviously on production I want the Certificate to be verified.
This thing work fine with NuSoap but most of the stuff in NuSoap is deprecated for our server which is running PHP 5.4.6, So the most reliable solution for me using PHP's SOAP extension. And the reason for me using Zend is we're in process of moving our system from some third party framework to Zend Framework and everyday I get requests from client to add this & that new components, I assumed if I develop every new request from Client using Zend libraries then it will be easy for me in later stages to move to Zend Framework.
openssl is enable and tried with defining local_cert as well, but no Joy.
I hope I made some sense there.
Basically looking for some instruction how to create Self Signed Certificates for this purpose, what should be the code for Server & Client.

Calling GWT RPC service

I have been going through the google tutorial ( which I find very good ) at
https://developers.google.com/web-toolkit/doc/latest/tutorial/RPC
I have the service up and running on my local server and my JavaScript client can call it fine. OK so far. Now, what I want to do is deploy the service on a remote server JoeSoapHost:8080
How do I now tell my client where to send it's requests? I can't see any server/url being created in my RPC call. It just works by magic but now I want to get under the bonnet and start breaking it.
[Edit}
This is the Interface my client uses to know what service on the Server is to be called. I know that my Web.xml web descriptor must have a url that matches this. It has this because my server is invoked ok. Problem is, if I now decide to deploy my server elsewhere how do I tell my client what server/domain name to use?
#RemoteServiceRelativePath("stockPrices")
public interface StockPriceService extends RemoteService
{
StockPrice[] getPrices(String[] symbols);
}
What I want to achieve first is have a simple GWT client calling into an RPC service. I have this working but only when the server is localhost.
Next step, I deploy my app to the Google App Engine. What must I change now because my RPC service in my JavaScript is not being called when I deploy my app to
http://stockwatcherjf.appspot.com/StockWatcher.html
1) Brian Slesinsky excellent document on RPC - https://docs.google.com/document/d/1eG0YocsYYbNAtivkLtcaiEE5IOF5u4LUol8-LL0TIKU/edit#heading=h.amx1ddpv5q4m
2) #RemoteServiceRelativePath("stockPrices") allows GWT code to determine relative to your host/server/domain i.e http//mydomain.com/gwtapp/stockPrices
3) You can search GOOGle IO Sessions from 2009 - 2012 for some more in depth stuff on GWT RPC usage.
#RemoteServiceRelativePath gives the path of the servlet relative to the GWT.getModuleBaseURL() (which is more or less the URL of the *.nocache.js script); it doesn't "just work by magic".
If you deploy your services on a different server than the one serving your client code, then you'll likely hit the Same Origin Policy. CORS can help here, but you'll lose compatibility with IE (up to IE9 included). You'd better stick serving everything from the same origin.

How to push contacts to Microsoft Exchange from Talend?

I'm trying to use Talend Open Studio to sync contacts from a variety of input sources into an Exchange 2007 server.
I know Talend can talk SOAP, and EWS has a WSDL, but having bumped into all
sorts of problems trying to marry the two together (since Exchange's WSDL is lacking elements which Talend needs) I don't know if that's the best plan of attack, or if I should be looking at building a more Exchange-specific plugin for Talend using the EWS Java API from MS.
Alternatively, if these are both known to not be possible, I'd appreciate a pointer to an explanation as to why - all the buzzwords seem to line up on each side, after all.
I work at Talend and would be happy to try and help you out a bit, but I myself am not familiar with the Exchange WSDL. I would assume that a SOAP interface from an established vendor like Microsoft is going to be WS-I Basic Profile compatible and should be easily invoked directly just like any regular WS. Would you mind trying the following:
What particular elements are missing from the MS WSDL, or is it trying to use some non-standard feature? CXF is fully JAX-WS compliant, and it is certified WS-I BP compliant, so I have to assume something odd is going on.
post the WSDL from exchange that you are trying to invoke from Talend.
create a proxy client for that WSDL using CXF.
Give it a try and send the error message.
Generate a mock service provider based on that wsdl using CXF and run the CXF mock and try against that with the CXF wsdl client. This will give you added confidence that the client and wsdl have no problems.
you can also try generating a simple test case with just SOAP UI or similar tooling against the Exchange WS.
ps: CXF is apache based open source. It is easy to use and has tight integration with Talend via the ASF suite. But you can also just use it by itself for diagnostic purposes.
Ed
I have been struggling with that too...
You can use tSoap for that purpose.
tWebServiceInput does not work for me with EWS.
tSoap->tLogRow
eg:
tSoap component that resolves a given name is the method ResolveNames()
Value to resolve = Thierry
Set "Need Authentication" with username and password
Set End Point, eg "https://yourserver/EWS/Exchange.asmx"
Set SOAP Action,
"http://schemas.microsoft.com/exchange/services/2006/messages/ResolveNames"
SOAP Version 1.1
Set SOAP Message:
... Enter Soap Method enclosed with ".
Joins tSoap to tLogRow
Run the Job. Voila the result...
Starting job xSoap_ResolveNames_LogRow at 13:43 30/05/2012.
[statistics] connecting to socket on port 3682
[statistics] connected
<Header><t:ServerVersionInfo xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" MajorBuildNumber="685" MajorVersion="8" MinorBuildNumber="24" MinorVersion="0" /></Header>|<m:ResolveNamesResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"><m:ResponseMessages><m:ResolveNamesResponseMessage ResponseClass="Success"><m:ResponseCode>NoError</m:ResponseCode><m:ResolutionSet IncludesLastItemInRange="true" TotalItemsInView="1"><t:Resolution><t:Mailbox><t:Name>Thierry TYS. Yen Suin</t:Name><t:EmailAddress>thierry.suin#sc-mauritius.com</t:EmailAddress><t:RoutingType>SMTP</t:RoutingType><t:MailboxType>Mailbox</t:MailboxType></t:Mailbox><t:Contact><t:DisplayName>Thierry Yen Suin</t:DisplayName><t:GivenName>Thierry</t:GivenName><t:EmailAddresses><t:Entry Key="EmailAddress1">SMTP:thierry.suin#sc-mauritius.com</t:Entry></t:EmailAddresses><t:ContactSource>ActiveDirectory</t:ContactSource><t:Surname>Yen Suin</t:Surname></t:Contact></t:Resolution></m:ResolutionSet></m:ResolveNamesResponseMessage></m:ResponseMessages></m:ResolveNamesResponse>|
[statistics] disconnected
Job xSoap_ResolveNames_LogRow ended at 13:43 30/05/2012. [exit code=0]
It should work similarly with a method that creates a contact.
Hope it helps because I haven't found a lot of post on integrating Talend with Exchange Web Services despite searching for a long time.