Click here to Skip to main content
15,887,135 members
Home / Discussions / C#
   

C#

 
GeneralRe: Single instance forms in an MDI app Pin
martin_hughes9-Sep-07 7:36
martin_hughes9-Sep-07 7:36 
GeneralRe: Single instance forms in an MDI app Pin
Ed.Poore9-Sep-07 9:12
Ed.Poore9-Sep-07 9:12 
GeneralRe: Single instance forms in an MDI app Pin
Ed.Poore9-Sep-07 13:39
Ed.Poore9-Sep-07 13:39 
QuestionNeed an Algorithm like 'Word Wrap' in notepad. Pin
hdv2128-Sep-07 6:54
hdv2128-Sep-07 6:54 
AnswerRe: Need an Algorithm like 'Word Wrap' in notepad. Pin
Giorgi Dalakishvili8-Sep-07 7:26
mentorGiorgi Dalakishvili8-Sep-07 7:26 
QuestionConsuming Java Web Service using C# Pin
arctix8-Sep-07 4:48
arctix8-Sep-07 4:48 
AnswerRe: Consuming Java Web Service using C# Pin
Guffa8-Sep-07 4:58
Guffa8-Sep-07 4:58 
QuestionRe: Consuming Java Web Service using C# [modified] Pin
arctix9-Sep-07 2:57
arctix9-Sep-07 2:57 
Well, thx. I read it twice. The only thing I could do else was:

"Sometimes VS misbehaves and does not generate this class. I don't understand why, but the work-around is to Show-all-files in the WinForms project and expand the web service > Reference.map > Reference.cs. Edit this file and change public partial class MTOM : System.Web.Services.Protocols.SoapHttpClientProtocol to public partial class MTOMWse : Microsoft.Web.Services3.WebServicesClientProtocol. Also make sure to update the constructor to match the new class name. Then it should compile fine."

Still no change. I'm still receiving the same exception. Here I'm giving a piece of web service code written in java to show how is the mtom composed.

package imageservice;

import javax.annotation.Resource;
import javax.jws.WebService;
import javax.xml.ws.BindingType;
import javax.xml.ws.WebServiceContext;
import javax.jws.WebMethod;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.File;
import java.io.IOException;
/**
*
* @author Hellburn
*/
@WebService()
@BindingType(value=javax.xml.ws.soap.SOAPBinding.SOAP11HTTP_MTOM_BINDING)
public class ImageService {
@Resource
private WebServiceContext wsContext;

/**
* Web service operation
*/
@WebMethod
public byte[] getJavaImage() {
byte[] data = null;
wsContext.getMessageContext().put(com.sun.xml.ws.developer.JAXWSProperties.MTOM_THRESHOLOD_VALUE,0);
// TODO implement operation
try{
File f = new File("c:/SomeFile.jpg");
FileInputStream fis = new FileInputStream(f);
long length = f.length();
data = new byte[(int)length];
int offset = 0;
int numRead = 0;
while (offset < data.length && (numRead=fis.read(data, offset, data.length-offset)) >= 0) {
offset += numRead;
}
fis.close();
}catch(FileNotFoundException fnfe){
fnfe.printStackTrace();
}catch(IOException ioe){
ioe.printStackTrace();
}
return data;
}
}

Maybe someone will come up with something what else I should do with my C# client application to make it run. I really don't know.


-- modified at 18:00 Sunday 9th September, 2007
QuestionGenerics Problem Question Pin
PaulPrice8-Sep-07 4:44
PaulPrice8-Sep-07 4:44 
AnswerRe: Generics Problem Question Pin
Giorgi Dalakishvili8-Sep-07 4:49
mentorGiorgi Dalakishvili8-Sep-07 4:49 
GeneralRe: Generics Problem Question Pin
PaulPrice8-Sep-07 4:58
PaulPrice8-Sep-07 4:58 
GeneralRe: Generics Problem Question Pin
Giorgi Dalakishvili8-Sep-07 5:05
mentorGiorgi Dalakishvili8-Sep-07 5:05 
GeneralRe: Generics Problem Question Pin
PaulPrice8-Sep-07 5:11
PaulPrice8-Sep-07 5:11 
GeneralRe: Generics Problem Question Pin
Giorgi Dalakishvili8-Sep-07 5:18
mentorGiorgi Dalakishvili8-Sep-07 5:18 
QuestionAntivirus question Pin
sajid.salim.khan8-Sep-07 4:20
sajid.salim.khan8-Sep-07 4:20 
AnswerRe: Antivirus question Pin
Paul Conrad8-Sep-07 4:26
professionalPaul Conrad8-Sep-07 4:26 
QuestionDataGrid control WinFroms Pin
somagunasekaran8-Sep-07 4:19
somagunasekaran8-Sep-07 4:19 
AnswerRe: DataGrid control WinFroms Pin
Paul Conrad8-Sep-07 4:27
professionalPaul Conrad8-Sep-07 4:27 
QuestionRythm game Pin
pokabot8-Sep-07 3:08
pokabot8-Sep-07 3:08 
AnswerRe: Rythm game Pin
Guffa8-Sep-07 3:56
Guffa8-Sep-07 3:56 
GeneralRe: Rythm game Pin
pokabot8-Sep-07 4:35
pokabot8-Sep-07 4:35 
QuestionArray Pin
edwinlazer8-Sep-07 2:35
edwinlazer8-Sep-07 2:35 
AnswerRe: Array Pin
Guffa8-Sep-07 2:46
Guffa8-Sep-07 2:46 
GeneralRe: Array Pin
edwinlazer9-Sep-07 19:28
edwinlazer9-Sep-07 19:28 
QuestionSharepoint server URL [modified] Pin
Ramamurthi8-Sep-07 2:10
Ramamurthi8-Sep-07 2:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.