Click here to Skip to main content
15,893,487 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I Have Form In Which I Used Web Refernces.. called ServiceReference2...
in which I have Called The One of Function Which is Define In Web Service


VB
Dim outputs As New List(Of ServiceReference2.InboundOutput)
                         Dim ins As New List(Of ServiceReference2.Inbound)
                         Dim objinbound() As ServiceReference2.Inbound
                         ReDim objinbound(100)
                         Dim objinbound2 As New ServiceReference2.Inbound
                         Dim objinbound3 As New ServiceReference2.Inbound
                         Dim j1 As New ServiceReference2.InboundDeliveryClient

dim success as boolean
success = j1.Authnetication(deliverystatus, outputs, uid, pass, "Yes", ins)

when i build my project I am Getting Following error....


1> Value of type 'System.Collections.Generic.List(Of ServiceReference2.InboundOutput)' cannot be converted to 'String'.

2> Value of type 'System.Collections.Generic.List(Of ServiceReference2.Inbound)' cannot be converted to '1-dimensional array of ServiceReference2.InboundOutput'.

3> Value of type 'String' cannot be converted to '1-dimensional array of ServiceReference2.Inbound'.



when i go to the defination of Function it shows like this

C#
Public Function Authnetication(
    ByVal strUserId As String,
    ByVal strPwd As String,
    ByVal Flag As String,
    ByVal objInbound() As ServiceReference2.Inbound, 
    ByRef strDeliveryStatus As String, 
    ByRef lstInboundOP() As ServiceReference2.InboundOutput
) As Boolean Member of ServiceReference2.InboundDeliveryClient

where as it actually...


Public Function Authnetication(
    ByRef strDeliveryStatus As String,
    ByRef lstInboundOP As System.Collections.Generic.List(Of ServiceReference2.InboundOutput), 
    ByVal strUserId As String,
    ByVal strPwd As String,
    ByVal Flag As String,
    ByVal objInbound As System.Collections.Generic.List(Of ServiceReference2.Inbound)
) As Boolean Member of ServiceReference2.InboundDeliveryClient



When I run the Same Above Code in Other Machine It Work Properly
is their any issue with .net framework or with my pc....



Thank You....
Posted
Updated 24-Feb-15 17:07pm
v3
Comments
Sergey Alexandrovich Kryukov 24-Feb-15 12:30pm    
Well, they cannot be converted, of course. What would be the purpose of your attempted implicit type conversion? What are you trying to achieve with that, in each case?
—SA
TheKarateKid 24-Feb-15 13:30pm    
@Kapil Nandgave - Are you saying that generated proxy has different types than the you defined in Service? i.e Generic List in Service but in Generated Proxy with one dimensional array?
Kapil Nandgave 24-Feb-15 23:26pm    
yes it showing different type rather than defined in the service...
TheKarateKid 25-Feb-15 8:52am    
Have you checks following things? What is the development environment you are using? Because following settings may not be available in other versions.
Whenever you add a service reference, click “Advanced..” button, in “Data Type” section the default selection for Collection Type is System.Array and Dictionary collection type is System.Colelctions.Generic.Dictionary, you can change either Collection Type or Dictionary collection type to match your requirement. These configured types will be used when generating the client proxy code for your solutions. If you have List<t> defined in the Service you can configure to use Generic List and so on.
These options which I am referring to are from Visual Studio 2010 Environment. Unfortunately in VS2008 you do not have that option. Also if you are trying to generate the proxy compatible to .NET 2.0 client then also you lose these options.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900