[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.remoting

Remoted Component generates soap exceptions when calling web service

Sam-I-Am

7/21/2004 11:57:00 AM

Hi All

I have an asp.net app that uses .net remoting to call a function on a remote
server. The function also calls a web service on the remote server to
perform its tasks.

All works fine untill I the .net remoted component calls the webservice. I
get the following error:
"The type System.Web.Services.Protocols.SoapException in Assembly
System.Web.Services", Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a is not marked as serializable"

The asp.net app can call the remote webservice directly without generating
an error. It only errors when using .net remoting.

Any ideas?

Sam


3 Answers

Sunny

7/21/2004 3:33:00 PM

0

Hi,

please, post the remote method which calls the service.

Sunny

In article <O$DlpmxbEHA.3512@TK2MSFTNGP12.phx.gbl>, samuel@3hgroup.com
says...
> Hi All
>
> I have an asp.net app that uses .net remoting to call a function on a remote
> server. The function also calls a web service on the remote server to
> perform its tasks.
>
> All works fine untill I the .net remoted component calls the webservice. I
> get the following error:
> "The type System.Web.Services.Protocols.SoapException in Assembly
> System.Web.Services", Version=1.0.5000.0, Culture=neutral,
> PublicKeyToken=b03f5f7f11d50a3a is not marked as serializable"
>
> The asp.net app can call the remote webservice directly without generating
> an error. It only errors when using .net remoting.
>
> Any ideas?
>
> Sam
>
>
>

Sam-I-Am

7/21/2004 10:42:00 PM

0

Here is the web.config from my remote object which is hosted in IIS:
<system.runtime.remoting>
<application>
<service>
<wellknown
mode="SingleCall" objectUri="Imaging.rem"
type="MyAssembly.Imaging, MyAssembly" />
</service>
<channels>
<channel ref="http">
<clientProviders>
<formatter ref="binary" />
</clientProviders>
</channel>
</channels>
</application>
</system.runtime.remoting>

This is the remoting config in my client asp.net app:
<system.runtime.remoting>
<application>
<channels>
<channel ref="http">
<clientProviders>
<formatter
ref="binary"
/>
</clientProviders>
</channel>
</channels>
<client>
<wellknown
type="Interfaces.IImaging, Interfaces"
url="http://myremoteserver:82/Imaging.rem"
/>
</client>
</application>
</system.runtime.remoting>

My asp.net client application uses the following to connect to the remote
host:
IImaging imaging = (IImaging) RemotingHelper.GetObject(typeof(IImaging));
imaging.CreateImageFromSVG(Various Parameters Here)


This is the method in the remote component that throws an exception. It
connects to the Adobe Graphics Server web service which is installed locally
on the remote server.

private bool CreateRasterImage(
string SVGInputPath,
string OutputPath,
string ImgWidth,
string ImgHeight,
string JPEGQuality,
string Target)
{
// Return boolean
bool result = false;
try
{
// Read in the current SVG file
FileInfo svgFile = new FileInfo(SVGInputPath);

// Create the Adobe Graphics Server commands
string strCommands =
BuildCommands(Target,JPEGQuality,ImgWidth,ImgHeight);

// Create the request and give it the commands
AdobeGraphicsServer.request request = new AdobeGraphicsServer.request();
request.commands = strCommands;

// Populate the request with the image data
request.files = new AdobeGraphicsServer.RequestFileType[1];
request.files[0] = new AdobeGraphicsServer.RequestFileType();
request.files[0].name = "srcfile";
request.variables = new AdobeGraphicsServer.RequestVariableType[0];

// Read the svg data into the files array
FileStream stream = File.OpenRead(svgFile.FullName);
request.files[0].data = new byte[stream.Length];
stream.Read(request.files[0].data, 0, (int) stream.Length);
stream.Close();

// Get the Adobe web service and execute the commands
AdobeGraphicsServer.Service service = new AdobeGraphicsServer.Service();
AdobeGraphicsServer.response Response = service.Execute(request); //
This is the line that causes the exceptions

AdobeGraphicsServer.ResultFileType resultfile = Response.files[0];
byte[] data = resultfile.data;

// Set up a file name and write the data out to the file
string outputfile = OutputPath;

System.IO.FileStream outstream = System.IO.File.OpenWrite(outputfile);
outstream.Write(data, 0, (int) data.Length);
outstream.Close();

if(File.Exists(outputfile)){result = true;}
}
catch(Exception Ex)
{
ExceptionHelper.Publish("Error in CreateRasterImage (" + Ex.Message +
")", Ex);
}
return result;
}

This what it returns:
"The type System.Web.Services.Protocols.SoapException in Assembly
System.Web.Services", Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a is not marked as serializable"

If I connect to the Adobe Graphics Servers directly from the client using
Web Services it seems to work fine!

Any ideas?

Sam


"Sunny" <sunny@newsgroups.nospam> wrote in message
news:enaVJgzbEHA.2408@tk2msftngp13.phx.gbl...
> Hi,
>
> please, post the remote method which calls the service.
>
> Sunny
>
> In article <O$DlpmxbEHA.3512@TK2MSFTNGP12.phx.gbl>, samuel@3hgroup.com
> says...
> > Hi All
> >
> > I have an asp.net app that uses .net remoting to call a function on a
remote
> > server. The function also calls a web service on the remote server to
> > perform its tasks.
> >
> > All works fine untill I the .net remoted component calls the webservice.
I
> > get the following error:
> > "The type System.Web.Services.Protocols.SoapException in Assembly
> > System.Web.Services", Version=1.0.5000.0, Culture=neutral,
> > PublicKeyToken=b03f5f7f11d50a3a is not marked as serializable"
> >
> > The asp.net app can call the remote webservice directly without
generating
> > an error. It only errors when using .net remoting.
> >
> > Any ideas?
> >
> > Sam
> >
> >
> >


Sunny

7/22/2004 3:01:00 AM

0

Looks like your Adobe web service throws an exception. Can you confirm that
exactly the same code, if put in a local method, gets the desired results?

Also, try to regenerate the web reference in the project which holds the
remoting object. Maybe the proxy class generated for the web service is
corrupted.

You can try as well to use some network sniffer to monitor the messages
exchanged between your remoting object and the Adobe webservice. As SOAP
messages are clear text, you will see if there is an exception in the
response, or the response is the right one, but your object does not
interpret it correctly.

One way or another, I do not see how this can because of the remoting.

Sunny

Sam-I-Am wrote:

> Here is the web.config from my remote object which is hosted in IIS:
> <system.runtime.remoting>
> <application>
> <service>
> <wellknown
> mode="SingleCall" objectUri="Imaging.rem"
> type="MyAssembly.Imaging, MyAssembly" />
> </service>
> <channels>
> <channel ref="http">
> <clientProviders>
> <formatter ref="binary" />
> </clientProviders>
> </channel>
> </channels>
> </application>
> </system.runtime.remoting>
>
> This is the remoting config in my client asp.net app:
> <system.runtime.remoting>
> <application>
> <channels>
> <channel ref="http">
> <clientProviders>
> <formatter
> ref="binary"
> />
> </clientProviders>
> </channel>
> </channels>
> <client>
> <wellknown
> type="Interfaces.IImaging, Interfaces"
> url="http://myremoteserver:82/Imaging.rem"
> />
> </client>
> </application>
> </system.runtime.remoting>
>
> My asp.net client application uses the following to connect to the remote
> host:
> IImaging imaging = (IImaging) RemotingHelper.GetObject(typeof(IImaging));
> imaging.CreateImageFromSVG(Various Parameters Here)
>
>
> This is the method in the remote component that throws an exception. It
> connects to the Adobe Graphics Server web service which is installed
> locally on the remote server.
>
> private bool CreateRasterImage(
> string SVGInputPath,
> string OutputPath,
> string ImgWidth,
> string ImgHeight,
> string JPEGQuality,
> string Target)
> {
> // Return boolean
> bool result = false;
> try
> {
> // Read in the current SVG file
> FileInfo svgFile = new FileInfo(SVGInputPath);
>
> // Create the Adobe Graphics Server commands
> string strCommands =
> BuildCommands(Target,JPEGQuality,ImgWidth,ImgHeight);
>
> // Create the request and give it the commands
> AdobeGraphicsServer.request request = new
> AdobeGraphicsServer.request(); request.commands = strCommands;
>
> // Populate the request with the image data
> request.files = new AdobeGraphicsServer.RequestFileType[1];
> request.files[0] = new AdobeGraphicsServer.RequestFileType();
> request.files[0].name = "srcfile";
> request.variables = new AdobeGraphicsServer.RequestVariableType[0];
>
> // Read the svg data into the files array
> FileStream stream = File.OpenRead(svgFile.FullName);
> request.files[0].data = new byte[stream.Length];
> stream.Read(request.files[0].data, 0, (int) stream.Length);
> stream.Close();
>
> // Get the Adobe web service and execute the commands
> AdobeGraphicsServer.Service service = new
> AdobeGraphicsServer.Service(); AdobeGraphicsServer.response Response =
> service.Execute(request); //
> This is the line that causes the exceptions
>
> AdobeGraphicsServer.ResultFileType resultfile = Response.files[0];
> byte[] data = resultfile.data;
>
> // Set up a file name and write the data out to the file
> string outputfile = OutputPath;
>
> System.IO.FileStream outstream = System.IO.File.OpenWrite(outputfile);
> outstream.Write(data, 0, (int) data.Length);
> outstream.Close();
>
> if(File.Exists(outputfile)){result = true;}
> }
> catch(Exception Ex)
> {
> ExceptionHelper.Publish("Error in CreateRasterImage (" + Ex.Message +
> ")", Ex);
> }
> return result;
> }
>
> This what it returns:
> "The type System.Web.Services.Protocols.SoapException in Assembly
> System.Web.Services", Version=1.0.5000.0, Culture=neutral,
> PublicKeyToken=b03f5f7f11d50a3a is not marked as serializable"
>
> If I connect to the Adobe Graphics Servers directly from the client using
> Web Services it seems to work fine!
>
> Any ideas?
>
> Sam
>
>
> "Sunny" <sunny@newsgroups.nospam> wrote in message
> news:enaVJgzbEHA.2408@tk2msftngp13.phx.gbl...
>> Hi,
>>
>> please, post the remote method which calls the service.
>>
>> Sunny
>>
>> In article <O$DlpmxbEHA.3512@TK2MSFTNGP12.phx.gbl>, samuel@3hgroup.com
>> says...
>> > Hi All
>> >
>> > I have an asp.net app that uses .net remoting to call a function on a
> remote
>> > server. The function also calls a web service on the remote server to
>> > perform its tasks.
>> >
>> > All works fine untill I the .net remoted component calls the
>> > webservice.
> I
>> > get the following error:
>> > "The type System.Web.Services.Protocols.SoapException in Assembly
>> > System.Web.Services", Version=1.0.5000.0, Culture=neutral,
>> > PublicKeyToken=b03f5f7f11d50a3a is not marked as serializable"
>> >
>> > The asp.net app can call the remote webservice directly without
> generating
>> > an error. It only errors when using .net remoting.
>> >
>> > Any ideas?
>> >
>> > Sam
>> >
>> >
>> >