 |

|
Hi sangeetha m,
Luckily BizTalk is a very mature product nowadays and there are many resources which can help you in becoming a good BizTalk developer.
To start with I'll point you to a number of books. A book which helped me getting my BizTalk 2006 certification was the predecessor of BizTalk 2010 Recipes.
You can take the recipes from the book and try them out on your own environment. This way you get more experienced on how to solve certain problems with BizTalk.
Other good books are:
- BizTalk Server 2010 Cookbook by Steef-Jan Wiggers
- BizTalk Server 2010 Patterns by Dan Rosanova
More recent BizTalk books can be found here: Sandro Pereira BizTalk Blog
If you feel ready for it, you can try to take the 70-595 certification and buy this book for preperation. But as a beginner in IT and BizTalk, don't take it lightly...
Off course there are many good blogs (a number of good ones can be found at Sandro's blog) and forums (BizTalkGurus, MSDN) and don't forget the Virtual labs on MSDN.
If you want to meet fellow BizTalkers, there are many BizTalk related groups on LinkedIn, many BizTalk people can be found on Twitter and (in the real world) you might join a local BizTalk User Group and enjoy some sessions on BizTalk!
Hope this helps!
Lex
|
|
|
|

|
hi lex,
thank u to made a path for learning BizTalk .. surely i will follow that references books .
|
|
|
|

|
netTcpBinding in my service app.config has security mode set to ‘None’and that is working fine. When I change it to the default mode of nettcpbinding i.e.Mode=Transport and clientCredentialType="Windows", I get following exception in GUI project while connecting to the this service
The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:00:59.6982306'.
I viewed service trace in trace viewer and that showed the following error message: The message with To 'net.tcp://localhost:9200/MyService/mex/mex' cannot be processed at the receiver, due to an AddressFilter mismatch at the EndpointDispatcher. Check that the sender and receiver's EndpointAddresses agree.
if I create a new service with a nettcpendpoint having default transport security, that works fine.
If anybody has any idea about this, please let me know.
|
|
|
|

|
Hello, sir
How can we start WCF application in visual studio 2010?
|
|
|
|

|
What do you mean by start? Start designing, developing, running? Please think about what you are trying to do and clarify your question.
One of these days I'm going to think of a really clever signature.
|
|
|
|

|
Menu File->New->Project, Select and Expand Visual C#, Select WCF...
What kind of WCF-project you want depends on your needs. Ask MSDN or Google for details and comparison.
|
|
|
|

|
I have a general question. Why sometimes should we use System.ServiceModel.Channels.Message class instead of some concrete class when we create WCF service?
For example:
1) We can use the following:
public Person GetPersonById(int id)
{
Person person = Employees.CreateEmployees().First(e => e.Id == id);
return person;
}
2) But we can use the following as well:
public Message GetPersonById(Message id)
{
string firstName = Employees.CreateEmployees().First(e => e.Id == id.GetBody<int>()).FirstName;
Message response = Message.CreateMessage(id.Version, ReplyAction, firstName);
return response;
}
What's the difference?
Thank you in advance.
Goran
|
|
|
|

|
I'm working on a Custom Start Page for VS 2010. For those who don't know, when you run a custom start page in development, VS opens an experimental instance of VS 2010 so you can try it.
I have a service reference to a WCF service in the app. When I run it in other applications I can call the service fine.
In this app, which is opening in an experimental instance, when I do
FalconServiceClient _serviceClient = new FalconServiceClient();
I get an exception:
Could not find default endpoint element that references contract 'FalconServiceRef.IFalconService' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.
I have copied the app.config to the instance's bin folder. Doesn't help.
Anyone have any ideas on this?
Thanks
If it's not broken, fix it until it is
|
|
|
|

|
What's the best way to check if a service is running?
If it's not broken, fix it until it is
|
|
|
|

|
whts the main use of self hosting
|
|
|
|

|
See here[^].
One of these days I'm going to think of a really clever signature.
|
|
|
|

|
Hi,
My situation is following: I have a bunch of XSD files as input only. And I know how WCF service contract should look like:
[ServiceContract]
public interface ICustomService
{
[OperationContract]
Message CustomAction(Message msg);
}
Message is SOAP message.
I need to create WSDL file based on XSD files. After that I should use that WSDL file and existing XSD files to create WCF service that should be in the form above.
The important thing is - everything should be done dynamically (programmatically). It means XSD files should be added to the process of WSDL creation also programmatically, created WSDL file should be used to invoke WCF service also programmatically...
So, if someone can write some code as putting me to right direction I'll be more than thankful.
Thank you in advance.
|
|
|
|

|
I have an XML file structured this way:
<Emulators>
<System>
<Name>Name1</Name>
<Kind name="lexplode"/>
<Kind name="sexplode"/>
<Kind name="dropbomb"/>
</System>
</Emulators>
If I want to read, in XAML, from <Name> I know that I have to do:
<TextBox Text="{Binding XPath=Name, UpdateSourceTrigger=PropertyChanged}"/>
But what if I want to read all the values under <Kind>> ?
And which control could receive them, a textbox, a listbox, ..?
Thanks a lot!!
modified 7 Sep '12 - 2:44.
|
|
|
|

|
Hi, I am a .NET developer, Please help me for the scenario mentioned below. I am having three machines (these three machines are having internet connections),lets assume client1, client2 and server. client1 will pass some data to server and server will push the data to client2. The problem is, client1 and client2 are behind proxy but server will have public IP means standalone machine. One workaround is, I can host a WCF service on server machine and client2 will keep pooling the server. but that I don't want. I want server should push the data to client2. Any suggestion is very much appreciated. Thanks / Deepak
|
|
|
|

|
I have XSD and WSDL files as input and should create Soap messages and extract Soap body from them. I know how to do that in VS2008 using code-first approach when I write interfaces and classes and use "Add Service Reference..." option. But, our requirement is not to use all these nice things because we get XSD and WSDL files and should create Soap message in some another way. My colleague tried to use svcutil.exe but he found it made the errors. So, can we do that by using some another tool or programmatically?
We use C# and .NET Framework 3.5.
Thank you in advance.
Goran
|
|
|
|

|
I have a Strange thing happening
<WebMethod(EnableSession:=True)> _
i have a web method with a
and the method before it returns something it will call another method Which also has the
<WebMethod(EnableSession:=True)> _
and another Method on a class will be called and in that method i have something like this
Dim Session As HttpSessionState = HttpContext.Current.Session
Session("usercompany_ID") = drUser("usercomp_id")
Session("user_id") = drUser("user_id")
Session("UCLev1_ID") = drUser("UCL1_ID")
Session("UCLev2_ID") = drUser("UCL2_ID")
Imidiately when i try to assign the drUser("usercomp_id") to the session to Session("usercompany_ID") i get an Error
drUser("usercomp_id") has a Value its not nothing
Error
Object reference not set to an instance of an object.
Thanks
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa[at]dotnetfunda.com
http://www.Dotnetfunda.com
|
|
|
|

|
can anyone suggest me from where to watch or download best learning wcf tutorial videos from scratch?
|
|
|
|
|

|
I used the ones found here under the heading WCF videos[^]. The videos are not brand new, but I found them quite useful.
Soren Madsen
|
|
|
|
|

|
Hello - I've imported a certificate into my "Trusted Root Certification Authority Store." The certificate icon has a tiny key image in the upper left-hand corner so the certificate appears to be associated with a private key. However, when I try to add a reference to the WCF service that uses this certificate the system returns the following error message:
"It is likely that certificate 'CN=RootCATest' may not have a private key that is capable of key exchange or the process may not have access rights for the private key."
Any idea what the problem might be? Based on googling it appears I should be able to right click the cert in my MMC and select "All Tasks" > "Manage Private Keys". However, this menu option is not available for my certificate for some reason. My understanding was that if the cert is in the proper store and it has the key image in the top left corner then everything should be go but this does not appear to be the case....
|
|
|
|

|
I have first hand seen an instance where the certificate displayed the behavior you stated yet nothing seemed to get the private key available. Deleting the cert and re-installing fixed the problem.
Member 3919049 wrote: I try to add a reference to the WCF service t
In windows 7/2008 you have to jump through hoops to make the cert have the correct permissions to be visible.
Member 3919049 wrote: However, this menu option is not available for my certificate for some reason.
I think I resolved this by running MMC as admin. But if all else fails there is a way to do it via the command line. You will need to google the specifics but the steps are.
1. Determine the file where the private key is stored (there is a tool to do this.)
2. Use or a command line tool to change the permissions on the file.
|
|
|
|

|
including the following parameter with makecert fixed the issue: -sky exchange
|
|
|
|

|
Ajax Call:
$.ajax({
type: "POST",
url: "http://SomeService/ServiceName.svc/GetSearchResults",
data: JSON.stringify({ parameters: serviceParameters }),
contentType: "application/json; charset=utf-8",
dataType: "XML",
success: function (response) {
$("#xmlText").text(response.xml);
},
error: function (msg) {
alert(msg.toString);
}
})
WCF Interface:
[OperationContract]
[WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Xml, RequestFormat = WebMessageFormat.Json,
UriTemplate = "GetSearchResults")]
XElement GetSearchResults(inputParameters parameters);
[OperationContract]
[WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, UriTemplate = "getFile")]
Stream GetFile(DocInfo info);
Web.config:
<system.web>
<compilation debug="true" targetFramework="4.0" />
<customErrors mode="Off"/>
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true">
</serviceHostingEnvironment>
<standardEndpoints>
<webHttpEndpoint>
<standardEndpoint name="" helpEnabled="true" automaticFormatSelectionEnabled="true"></standardEndpoint>
</webHttpEndpoint>
</standardEndpoints>
</system.serviceModel>
The service is hosted on IIS6.
When I call the service I get the following error message:
500 System.ServiceModel.ServiceActivationException
I can call the GetFile method and get the response stream but I get the error message when calling GetSearchResults.
Any help will be appreciated.
|
|
|
|

|
Hello. Please, can somebody advise me? I create WCF library that realizes endpoint net-pipe for job with external WCF.I placed lib in Windows Service. But I dont know how to make data exchange from library without usage of WCF client-server mechanism. How can I put or get data from running WCF service? for example I want to register WCF errors in Eventlog or give parameters to service for transfer them for clients connected to WCF. Thanks a lot
|
|
|
|

|
Hi Guys,
I am consuming a WCF for my Windows 7 application, but while getting the response I get CommunicationException message for the response. I have also listed the exception details below,
{System.ServiceModel.CommunicationException: CommunicationException;
System.Net.WebException: The remote server returned an error: NotFound.;
System.Net.WebException: The remote server returned an error: NotFound.
at System.Net.Browser.ClientHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)
at System.Net.Browser.ClientHttpWebRequest.<>c__DisplayClass2.<EndGetResponse>b__1(Object sendState)
at System.Net.Browser.AsyncHelper.<>c__DisplayClass4.<BeginOnUI>b__0(Object sendState)
at System.Reflection.RuntimeMethodInfo.InternalInvoke(RuntimeMethodInfo rtmi, Object obj, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess, StackCrawlMark& stackMark)
at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, StackCrawlMark& stackMark)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at System.Delegate.DynamicInvokeOne(Object[] args)
at System.MulticastDelegate.DynamicInvokeImpl(Object[] args)
at System.Delegate.DynamicInvoke(Object[] args)
at System.Windows.Threading.Dispatcher.<>c__DisplayClass4.<FastInvoke>b__3()
at System.Reflection.RuntimeMethodInfo.InternalInvoke(RuntimeMethodInfo rtmi, Object obj, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess, StackCrawlMark& stackMark)
at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, StackCrawlMark& stackMark)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at System.Delegate.DynamicInvokeOne(Object[] args)
at System.MulticastDelegate.DynamicInvokeImpl(Object[] args)
at System.Delegate.DynamicInvoke(Object[] args)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.Dispatch(DispatcherPriority priority)
at System.Windows.Threading.Dispatcher.OnInvoke(Object context)
at System.Windows.Hosting.CallbackCookie.Invoke(Object[] args)
at System.Windows.Hosting.DelegateWrapper.InternalInvoke(Object[] args)
at System.Windows.RuntimeHost.ManagedHost.InvokeDelegate(IntPtr pHandle, Int32 nParamCount, ScriptParam[] pParams, ScriptParam& pResult)
at System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state)
at System.Net.Browser.ClientHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult result)
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.OnGetResponse(IAsyncResult result)
at System.Net.Browser.ClientHttpWebRequest.<>c__DisplayClassa.<InvokeGetResponseCallback>b__8(Object state2)
at System.Threading.ThreadPool.WorkItem.doWork(Object o)
at System.Threading.Timer.ring()
at System.ServiceModel.Channels.HttpChannelUtilities.ValidateAuthentication(HttpWebRequest request, HttpWebResponse response, WebException responseException, HttpChannelFactory factory)
at System.ServiceModel.Channels.HttpChannelUtilities.ValidateRequestReplyResponse(HttpWebRequest request, HttpWebResponse response, HttpChannelFactory factory, WebException responseException)
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.ProcessResponse(HttpWebResponse response, WebException responseException)
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult result)
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.OnGetResponse(IAsyncResult result)
at System.Net.Browser.ClientHttpWebRequest.<>c__DisplayClassa.<InvokeGetResponseCallback>b__8(Object state2)
at System.Threading.ThreadPool.WorkItem.doWork(Object o)
at System.Threading.Timer.ring()
}
Any help is very much appreciated for the same
|
|
|
|

|
It says "The remote server returned an error: NotFound"
Either it can't find the server, or there is something on the server missing. Do you have an empty test-application to test the connection with a minimal setup?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|

|
Generally the "The remote server returned an error: NotFound." is very difficult to find out the cause of the error. You can test your WCF service using some HTTP debugging tools such as "Fiddler" http://www.fiddler2.com/fiddler2/[^]
|
|
|
|

|
I have A WCF service running on IIS with my website. It is used with a program I am going to make as a verification tool. It is passed a company name and a product key.
I keep getting this 400 error. I have looked for hours on the internet but can't find a solution.
Here is my web.config:
="1.0"
="system.web.extensions" ="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
="scripting" ="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
="scriptResourceHandler" ="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" ="false" ="MachineToApplication"
="webServices" ="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
="jsonSerialization" ="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" ="false" ="Everywhere"
="profileService" ="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" ="false" ="MachineToApplication"
="authenticationService" ="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" ="false" ="MachineToApplication"
="roleService" ="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" ="false" ="MachineToApplication"
="true" ="100"
="false" ="true"
="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"
="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"
="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"
="asp" ="System.Web.UI" ="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
="asp" ="System.Web.UI.WebControls" ="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
="*" ="*.asmx"
="*" ="*.asmx" ="false" ="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
="*" ="*_AppService.axd" ="false" ="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
="GET,HEAD" ="ScriptResource.axd" ="false" ="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
="ScriptModule" ="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
="Verify"
="true" ="false"
="false"
="Verify" ="TreatMan.Service.Verify"
="http://www.gl2computersolutions.co.uk/service/Verify.svc" ="wsHttpBinding"
="TreatMan.Service.iTreatMan"
="false"
="true"
="ScriptModule"
="ScriptModule" ="managedHandler" ="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
="false"
="false"
="WebServiceHandlerFactory-Integrated"
="ScriptHandlerFactory"
="ScriptHandlerFactoryAppServices"
="ScriptResource"
="ScriptHandlerFactory" ="*" ="*.asmx" ="integratedMode" ="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
="ScriptHandlerFactoryAppServices" ="*" ="*_AppService.axd" ="integratedMode" ="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
="ScriptResource" ="GET,HEAD" ="ScriptResource.axd" ="integratedMode" ="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
="vb;vbs;visualbasic;vbscript" =".vb" ="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" ="4"
="CompilerVersion" ="v3.5"
="OptionInfer" ="true"
="WarnAsError" ="false"
="v2.0.50727" ="urn:schemas-microsoft-com:asm.v1"
="System.Web.Extensions" ="31bf3856ad364e35"
="1.0.0.0-1.1.0.0" ="3.5.0.0"
="System.Web.Extensions.Design" ="31bf3856ad364e35"
="1.0.0.0-1.1.0.0" ="3.5.0.0"
If it help it is located at ~/Service/Web.Config I don't know whether you can have two Web.Configs in different folders. The other is in the root folder.
This is the interface if it helps:
<ServiceContract()>
Public Interface iTreatMan
<OperationContract()>
Function Verfication(ByVal CompanyName As String, ByVal ProductKey As String) As CompositeType
End Interface
The service is called Verify and the project is called TreatMan.Service.
Any help would be highly appreciated.
|
|
|
|

|
I have done some examples on Per Session and Per Call as provided in these urls,
Three ways to do WCF Instance Managaement, and PerCall Service. Both the examples are almost same.
My issue is, I am not getting the output correctly as provided in those examples. When I want to use Per Session, I need to declare the variable as 'static'. When I want to use Per Call, I need to declare the variable without the keyword 'static'. Is this the expected behavior or am I something wrong? Single Instance is working with/out static.
Please provide any suggestions.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|

|
I am in the the process of building an iphone app that would access MSSQL database through a RESTful WCF. At the heart of my iphone app, customer will plug their info, take a pic, maybe audio file and small txt file along with some other simple info to update database. I was thinking, I would bundle all that up in some object and post it via HTTP into WCF, which then updates the db.
I have some doubts about this as WCF expects One Stream parameter, and nothing else along in same method, So Stream parameter can't be part of the object.
I would like to deal with JSON. Does anyone have an idea of what's the best way to do this? Note, I am able to post txt file, Stream Image file as seperate methods at the moment. I am hoping to bundle that up and make one post request to get that done.
Thanks
|
|
|
|

|
Software2007 wrote: Stream Image file as seperate methods at the moment. I
Since you already know how to do that then why not just stream everything? So instead of trying to create additional input idioms just create a message with all of the data and then stream that.
You could even use JSON to serialize the message and thus stream that.
|
|
|
|

|
Well, I am still confused. This is the kinda of the object I would like to send over from iOS to WCF eventually.
ObjectToSend{
string firstname;
string lastname;
int ID;
string Notes
Stream Image;
Stream AudioFile;
Stream textfile;
etc...
}
- Will I able able to send an object like this where it does have Stream datatype members?
Right now, I am able to send JSON objects like this one because its easy to represent it as JSON
ObjectToSend{
string firstname;
string lastname;
int ID;
string Notes
}
And I can upload image using stream mode as
void uploadImage(Stream image).
I am just not quite sure if and how I can have the Stream as member of an object, when WCF allows only Single Stream input/output parameter. I feel like there is a way, I just can't wrap my head around it.
|
|
|
|

|
Stream is a reader that you can implement. So the stream can send anything.
So
1. You have object X which includes a stream.
2. You create reader B which is a stream.
3. When B is 'read' it sends the normal properties first then it 'sends' the included stream by reading it.
|
|
|
|

|
I am sorry, I can't follow. Could you comment based on the following psuedo code?
for Image: (Stream mode transfer)
from iphone: I send the image in bytes posted to the body of HTTP request.
On WCF: void Upload(Stream imageData)
{
}
For ObjSomething:{string first, string last, int ID}
In iPhone: I build a Dictionary with the object structure, attach it HTTP Request Posbody as JSON object.
In WCF: void postData(ObjectSomething obj)
{
obj.first =
obj.last =
...
}
The above works fine. Now, I need to send ObjX{string first, string last, Stream imageData}
Did you mean I could do this?
iphone: Somehow attach Json and image data to request?
AND
WCF: void PostObjectX(ObjX obj)
{
first=obj.first, last=obj.last,...
Stream stm = obj.ImageData;
}
See the respons in this link, suggests that only the Stream can be in the body and other parameters may go in the heading. http:
modified 29 Jun '12 - 19:06.
|
|
|
|

|
At this point concentrate on creating a class that is suitable for delivering bytes and only bytes. It will have nothing to do with WCF nor JSON.
As a suggestion look a System.IO.Stream. Derive a class from that. Override all methods that are appropriate so you can read/write a test class a binary data.
Once you get that general concept down then look at BinaryReader and BinaryWriter.
And look to WCF to see exactly what Stream class it expects. That will be your target implementation.
|
|
|
|

|
Great. I will do that. I was just wondering what is the normal way of doing this, I would think this is common thing to be sending objects like this between mobile apps and WCF. Are there more user friendly technologies, I am willing to use the appropriate thing whenever necessary!
|
|
|
|

|
Software2007 wrote: what is the normal way of doing this,
The normal way for WCF doesn't involve streams.
|
|
|
|

|
Well, What is normal to send streams? The goal is to send data from iphone to SQL database on some windows server including files, images and other primitive types. Should I be thinking sockets as opposed to WCF? When I googled such thing, everything seemed to point to webservices, I realized that classic webservice doesn't work well with JSON. So, I tried WCF, only to find out it accepts one Stream parameter! So, let me ask this:
Basically I want to send some parameters mostly strings, couple of images, txt file, and audio file from iphone app to SQL database. I would like to send one http post request with all that, but how much of performance hit would it be if I do 3 or 4 http requests as in post parameters, then post image, then post file since WCF is built to handle one Stream parameter at a time?
modified 3 Jul '12 - 23:41.
|
|
|
|

|
Focus on your goal and ignore the details. Find a solution that works and implement it. Don't worry about whether it is "normal" or not.
|
|
|
|

|
Ok, got it to where I read the stream, parse it and extract text and images from it. I do have a new problem, the binary data request sent from the iPhone is posted as the body of http post request. Everything works fine as long as the request doesn't exceed 65535 bytes. When it does exceed, the Wcf method doesn't even get called or invoked at all. I am not sure to where the problem might be.
Here is my web.config
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<httpRuntime maxRequestLength="524288"/> </system.web>
<system.serviceModel>
<bindings>
<webHttpBinding>
<binding name="StreamedRequestWebBinding" bypassProxyOnLocal="true" useDefaultWebProxy="false" hostNameComparisonMode="WeakWildcard" sendTimeout="10:15:00" openTimeout="10:15:00" receiveTimeout="10:15:00" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" maxBufferPoolSize="2147483647" transferMode="Streamed">
<readerQuotas maxArrayLength="2147483647" maxStringContentLength="2147483647"/>
</binding>
</webHttpBinding>
</bindings>
<services>
<service name="JsonWcfService.GetEmployees" behaviorConfiguration="EmpServiceBehaviour">
<endpoint address ="" binding="webHttpBinding" bindingConfiguration="StreamedRequestWebBinding" contract="JsonWcfService.IGetEmployees" behaviorConfiguration="web">
</endpoint>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="EmpServiceBehaviour">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="web">
<webHttp automaticFormatSelectionEnabled="true"/>
</behavior>
</endpointBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
modified 6 Jul '12 - 10:54.
|
|
|
|

|
Http 'chunks' requests over certain limits which means it breaks it into pieces.
I suspect you need to do something slightly different in your WCF code to get around that.
|
|
|
|

|
Found it. It's my mistake, I have my WCF hosted in localhost IIS7.5, but The changes I applied to my web.config in my project were not translated to the web.config that is being consumed under IIS7.5.
Thanks for the help and for hanging in with my many posts. You did steer me to the correct solution by inheriting a custom stream object to handle images and file uploads within one request, but I might rethink this approach, and stick with the 'more standard' REST approach of one stream parameter, even though this may require multiple http requests to achieve the same thing - depending on performance. But, I know both ways and I can use either.
Thanks again.
|
|
|
|

|
WCF Is Windows comunication
|
|
|
|

|
Hello Everyone,
For the first time I am daring to ask a question on codeproject, so please bear with me.
I wish to write a WCF service on which various clients will be posting data. Based on the data received, the Windows work flow will start transitioning states (as opposed to sequential one).
The Expense Reporting sample is way too heavy and am unable to get that running.
So any step-by-step resource which I can refer to get the integration of WCF and WF in 4.0?
Thanks.
Vishal.
|
|
|
|
|

|
- I created HelloWorld WCF service.
- I followed instructions to host it on IIS 7.0
I can do this fine: localhost:4567/Service1.svc
I can do this fine: 192.168.1.101:4567/Service1.svc
This still shows port# though, I want to be able to do something like this without the need to specify the port: localhost/Service1.svc. so I can access it from my other machine 192.168.1.102. How can I set it up that way on my local machine? The end goal is to access my local machine from iOS and read JSON data.
Thanks
|
|
|
|

|
You still need to specify a port number, the IP address alone is not sufficient for connecting across a network.
|
|
|
|

|
Strange, I never had to with a web Service. I used to do this from my other machine:
http://192.168.1.101/WebService/something.asmx.
I think we don't need to specify a port once its deployed on IIS, isn't this the point of getting hosted on IIS so we can do:
somedomain.com/service.svc ?
Anyways, I was able to create a virtual directory so I could do that.
|
|
|
|

|
Yes, but in this case the port is selected according to the protocol specifier in the URI. The http specifier means redirect to the well-known port that handles the HTTP protocol: port 80.
|
|
|
|
 |
|