Hi,
I want to call/I need to use the WebSvcCopy (copy.asmx).
in visual studio and i want to upload a document in office365 document library.
I dont know how to call these services in visual studio i am getting an error
Error:
System.ServiceModel.ProtocolException: The content type text/html; charset=utf-8
of the response message does not match the content type of the binding (text/xm
l; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupp
orted method is implemented properly. The first 797 bytes of the response were:
'
<html>
<head><link rel="alternate" type="text/xml" href="/_vti_bin/copy.asmx?disco"
/>
<style type="text/css">
BODY { color: #000000; background-color: white; font-family: Ver
dana; margin- margin- }
#content { margin- font-size: .70em; padding-bottom:
2em; }
A:link { color: #336699; font-weight: bold; text-decoration: und
erline; }
A:visited { color: #6699cc; font-weight: bold; text-decoration:
underline; }
A:active { color: #336699; font-weight: bold; text-decoration: u
nderline; }
A:hover { color: cc3300; font-weight: bold; text-decoration: und
erline; }
P { color: #000000; margin- margin-bottom: 12px; font-f
amily: Verdana; }
pre { background-color: #e5e5cc; padding: 5px; font-family: Cour
ier New; font'.
Server stack trace:
at System.ServiceModel.Channels.HttpChannelUtilities.ValidateRequestReplyResp
onse(HttpWebRequest request, HttpWebResponse response, HttpChannelFactory factor
y, WebException responseException, ChannelBinding channelBinding)
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpCha
nnelRequest.WaitForReply(TimeSpan timeout)
at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeS
pan timeout)
at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message messag
e, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean on
eway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan tim
eout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean on
eway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCall
Message methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage req
Msg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgDa
ta, Int32 type)
at YBBEST.CreateDocumentItem.CopyWS.CopySoap.CopyIntoItems(CopyIntoItemsReque
st request)
at YBBEST.CreateDocumentItem.CopyWS.CopySoapClient.YBBEST.CreateDocumentItem.
CopyWS.CopySoap.CopyIntoItems(CopyIntoItemsRequest request) in e:\systemdrivers\
YBBEST.CreateDocumentItem\YBBEST.CreateDocumentItem\Service References\CopyWS\Re
ference.cs:line 421
at YBBEST.CreateDocumentItem.CopyWS.CopySoapClient.CopyIntoItems(String Sourc
eUrl, String[] DestinationUrls, FieldInformation[] Fields, Byte[] Stream, CopyRe
sult[]& Results) in e:\systemdrivers\YBBEST.CreateDocumentItem\YBBEST.CreateDocu
mentItem\Service References\CopyWS\Reference.cs:line 430
at YBBEST.CreateDocumentItem.CopyWSProxyWrapper.UploadFile(String sourceUrl,
String[] destinationUrls, Byte[] documentBytes, FieldInformation[] fileMetadata)
in e:\systemdrivers\YBBEST.CreateDocumentItem\YBBEST.CreateDocumentItem\CopyWSP
roxyWrapper.cs:line 34
File TestDoc2.pdf has successfully been uploaded to the document library
can anybody pls tell me how to how to do this,wht the meaning of above error
Thanks and Regards
Mahesh